How to Use PowerShell to Display the Statistics of a Management Agent

How to Use PowerShell to Display the Statistics of a Management Agent

FIM ScriptBox Item

Summary

The script lists the synchronization statistics of a management agent.

Script Code

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
if($args.count -ne 1) {throw "Missing parameter "}
 $maName = $args[0]
#------------------------------------------------------------------------------------------------------------
 $lstMA = @(get-wmiobject -class "MIIS_ManagementAgent" -namespace "root\MicrosoftIdentityIntegrationServer"`
                          -computername "." -filter "Name='$maName'") 
 if($lstMA.count -eq 0) {throw "MA not found"}
#------------------------------------------------------------------------------------------------------------
 write-host ""
 write-host "Management Agent Statistics" -foregroundcolor white -backgroundcolor darkblue
 write-host "`nGeneral " -foregroundcolor white -backgroundcolor darkgreen 
 write-host "Name : $maName"
 write-host "Count : $($lstMA[0].NumCSObjects().ReturnValue)"
 write-host "Placehoders: $($lstMA[0].NumPlaceholders().ReturnValue)"
 write-host "Connectors " -foregroundcolor white -backgroundcolor darkgreen 
 write-host "Total : $($lstMA[0].NumTotalConnectors().ReturnValue)"
 write-host "Count : $($lstMA[0].NumConnectors().ReturnValue)"
 write-host "Explicit : $($lstMA[0].NumExplicitConnectors().ReturnValue)"
 write-host "Disconnectors " -foregroundcolor white -backgroundcolor darkgreen 
 write-host "Total : $($lstMA[0].NumTotalDisconnectors().ReturnValue)"
 write-host "Count : $($lstMA[0].NumDisconnectors().ReturnValue)"
 write-host "Explicit : $($lstMA[0].NumExplicitDisconnectors().ReturnValue)"
 write-host "Import " -foregroundcolor white -backgroundcolor darkgreen 
 write-host "Unchanged : $($lstMA[0].NumImportNoChange().ReturnValue)"
 write-host "Add : $($lstMA[0].NumImportAdd().ReturnValue)"
 write-host "Update : $($lstMA[0].NumImportUpdate().ReturnValue)"
 write-host "Delete : $($lstMA[0].NumImportDelete().ReturnValue)"
 write-host "Export " -foregroundcolor white -backgroundcolor darkgreen 
 write-host "Update : $($lstMA[0].NumExportUpdate().ReturnValue)"
 write-host "Add : $($lstMA[0].NumExportAdd().ReturnValue)"
 write-host "Delete : $($lstMA[0].NumExportDelete().ReturnValue)"
 write-host "Profile Run " -foregroundcolor white -backgroundcolor darkgreen 
 write-host "Name : $($lstMA[0].RunProfile().ReturnValue)"
 write-host "Date : $($lstMA[0].RunStartTime().ReturnValue)"
 write-host "Status : $($lstMA[0].RunStatus().ReturnValue)`n"
#------------------------------------------------------------------------------------------------------------
 trap  
 { 
    Write-Host "`nError: $($_.Exception.Message)" -foregroundcolor white -backgroundcolor darkred 
    Write-Host ""
    Exit
 }
#------------------------------------------------------------------------------------------------------------

 

note Note
To provide feedback about this script, create a post on the FIM TechNet Forum.
For more FIM related Windows PowerShell scripts, see the FIM ScriptBox.

 

Leave a Comment
  • Please add 3 and 6 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Comments
  • Ed Price MSFT edited Revision 1. Comment: Our title standard is to use "How to" and no gerunds.

  • Craig Lussier edited Revision 2. Comment: added en-US to tags and title

Page 1 of 1 (2 items)
Wikis - Comment List
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Ed Price MSFT edited Revision 1. Comment: Our title standard is to use "How to" and no gerunds.

  • Craig Lussier edited Revision 2. Comment: added en-US to tags and title

Page 1 of 1 (2 items)