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 "Placeholders: $($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.

 



See Also