Reserved

Microsoft.Unix.EnumerateAvailableAgents.Task (Task)

Element properties:

TargetMicrosoft.SystemCenter.ManagementServer
AccessibilityPublic
CategoryCustom
EnabledTrue
RemotableFalse
Timeout300

Member Modules:

ID Module Type TypeId RunAs 
WA WriteAction Microsoft.Windows.ScriptWriteAction Default

Source Code:

<Task ID="Microsoft.Unix.EnumerateAvailableAgents.Task" Accessibility="Public" Enabled="true" Target="SC!Microsoft.SystemCenter.ManagementServer" Timeout="300" Remotable="true">
<Category>Custom</Category>
<WriteAction ID="WA" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>EnumerateAvailableAgents.vbs</ScriptName>
<Arguments/>
<ScriptBody><Script>
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
Option Explicit

Dim oFso, RootFolder, s
Dim Agent, Agents
Dim OMInstallFolder, AgentFolder
Dim WshShell, AgentPath

' Get Install Directory from Registry
Set WshShell = WScript.CreateObject("WScript.Shell")
OMInstallFolder = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup\InstallDirectory")

AgentFolder = OMINstallFolder &amp; "AgentManagement\UnixAgents"

' Create File System object
Set oFso = CreateObject("Scripting.FileSystemObject")

' Check if UnixAgent folder exists
If (oFso.FolderExists(AgentFolder)) Then
' Set folder to UnixAgent Folder
Set RootFolder = oFso.GetFolder(AgentFolder)
Set Agents = RootFolder.Files

s = "&lt;SupportedAgents&gt;"
s = s &amp; "&lt;Path&gt;" &amp; RootFolder &amp; "&lt;/Path&gt;"

For Each Agent in Agents
' Get Agents
s = s &amp; "&lt;Agent&gt;" &amp; Agent.Name &amp; "&lt;/Agent&gt;"
Next

s = s &amp; "&lt;/SupportedAgents&gt;"

' Return XML Results
WScript.Echo s
Else
s = "&lt;SupportedAgents/&gt;"
WScript.Echo s
End If
</Script></ScriptBody>
<TimeoutSeconds>60</TimeoutSeconds>
</WriteAction>
</Task>