Microsoft Identity Integration Server 2003 Developer Reference |
The example first retrieves the management agent collection and then enumerates through the collection to get the properties of each management agent.
Option Explicit On Error Resume Next Const PktPrivacy = 6 Dim ManagementAgentSet Dim ManagementAgent Set Service = GetObject("winmgmts:{authenticationLevel=PktPrivacy}!root\MicrosoftIdentityIntegrationServer") Set ManagementAgentSet = Service.ExecQuery("Select * from MIIS_ManagementAgent") For each ManagementAgent in ManagementAgentSet WScript.Echo "Name : " & ManagementAgent.Name WScript.Echo "GUID : " & ManagementAgent.Guid WScript.Echo "Type : " & ManagementAgent.Type If ManagementAgent.RunProfile() = "" then WScript.Echo "No Run Profiles configured for this management agent." _ & vbcrlf Else WScript.Echo "Run Profile Details" WScript.Echo " Name : " & ManagementAgent.RunProfile() WScript.Echo " Run Number : " & ManagementAgent.RunNumber() WScript.Echo " Status : " & ManagementAgent.RunStatus() WScript.Echo " Start Time : " & ManagementAgent.RunStartTime() WScript.Echo " End Time : " & ManagementAgent.RunEndTime() WScript.Echo " Run Details: " & ManagementAgent.RunDetails() & vbcrlf End If Next Sub ErrorHandler (ErrorMessage) WScript.Echo ErrorMessage WScript.Quit(1) End Sub