The MIIS_ManagementAgent Class defines the following methods:

The following example shows how you can use Microsoft Visual Basic Scripting Edition (VBScript) to get the counter return values of all management agents that are installed on the server.

XAML  Copy Code
Option Explicit

On Error Resume Next

Dim Service
Dim ManagementAgents
Dim ManagementAgent

Set Service= GetObject("winmgmts:root\MicrosoftIdentityIntegrationServer")
Set ManagementAgents = Service.ExecQuery("Select * from MIIS_ManagementAgent" )

For Each ManagementAgent in ManagementAgents
	Dim MAStatistics


	' Management Agent Statistics
	MAStatistics = ManagementAgent.Name _
						& "Management Agent Run Statistics" & vbcrlf

	MAStatistics = MAStatistics & "	Run Profile Name: " _
						& ManagementAgent.RunProfile() & vbcrlf

	MAStatistics = MAStatistics & "	Start Time	: " _
						& ManagementAgent.RunStartTime() & vbcrlf
					
	MAStatistics = MAStatistics & "	End Time		: " _
						& ManagementAgent.RunEndTime() & vbcrlf
					

	' Object Counter Statistics
	MAStatistics = MAStatistics & vbcrlf _
						& "Connector Space Object Counters" & vbcrlf
					
	MAStatistics = MAStatistics _
						& "   Total Connector Space Objects: " _
							& ManagementAgent.numCSObjects() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Total Connector Objects	: " _
							& ManagementAgent.numConnectors() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Explicit Connector Objects   : " _
							& ManagementAgent.numExplicitConnectors() & vbcrlf
						
	MAStatistics = MAStatistics _
						& "   Total Connector Objects	: " _
							& ManagementAgent.numTotalConnectors() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Total Disconnector Objects   : " _
							& ManagementAgent.numTotalDisconnectors() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Disconnectors Objects		: " _
							& ManagementAgent.numDisconnectors() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Explicit Disconnector Objects: " _
							& ManagementAgent.numExplicitDisconnectors() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Filtered Disconnectors	 : " _
							& ManagementAgent.numFilteredDisconnectors() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Placeholder Objects		: " _
							& ManagementAgent.numPlaceholders() & vbcrlf

	 
	' Pending Import Statistics
	MAStatistics = MAStatistics & vbcrlf & "Pending Imports" & vbcrlf

	MAStatistics = MAStatistics _
						& "   Import Add Objects	: " _
							& ManagementAgent.numImportAdd() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Import Update Objects   : " _
							& ManagementAgent.numImportUpdate() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Import Delete Objects   : " _
							& ManagementAgent.numImportDelete() & vbcrlf

	MAStatistics = MAStatistics _
						& "   Import No Change Objects: " _
							& ManagementAgent.numImportNoChange() & vbcrlf


	' Pending Export Statistics
	MAStatistics = MAStatistics & vbcrlf & "Pending Exports" & vbcrlf

	MAStatistics = MAStatistics _
						& "   Export Add Objects   : " _
							& ManagementAgent.numExportAdd() & vbcrlf
					
	MAStatistics = MAStatistics _
						& "   Export Update Objects: " _
							& ManagementAgent.numExportUpdate() & vbcrlf
					
	MAStatistics = MAStatistics _
						& "   Export Delete Objects: " _
							& ManagementAgent.numExportDelete() & vbcrlf

	WScript.Echo MAStatistics
Next

Sub ErrorHandler (ErrorMessage)
  WScript.Echo ErrorMessage
  WScript.Quit(1)
End Sub

See Also