• Home
  • Library
  • Wiki
  • Learn
  • Gallery
  • Downloads
  • Support
  • Forums
  • Blogs
Resources For IT Professionals
Microsoft Technet Image
United Kingdom (Proper English-like)
Skip to locale bar
    •  
    Wiki  >  TechNet Articles  > 
    • Article
    • History

    How to Use PowerShell to Display the Export State of a Management Agent - TechNet Articles - United States (English) - TechNet Wiki

    FIM ScriptBox Item

    Summary

    The script code below displays the pending exports for a management agent.
    You can use this script to troubleshoot export related issues.

     

    Script Code

    001
    002
    003
    004
    005
    006
    007
    008
    009
    010
    011
    012
    013
    014
    015
    016
    017
    018
    019
    020
    021
    #-------------------------------------------------------------------------------------------------------------
     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 "`nPending Exports For Management Agent"
     write-host "===================================="
     write-host "Name : $maName"
     write-host "Update : $($lstMA[0].NumExportUpdate().ReturnValue)"
     write-host "Add : $($lstMA[0].NumExportAdd().ReturnValue)"
     write-host "Delete : $($lstMA[0].NumExportDelete().ReturnValue)`n"
    #-------------------------------------------------------------------------------------------------------------
     trap  
     write-host "Update : $($lstMA[0].NumExportUpdate().ReturnValue)"
     write-host "Add : $($lstMA[0].NumExportAdd().ReturnValue)"
     write-host "Delete : $($lstMA[0].NumExportDelete().#000000;"> { 
        Write-Host "`nError: $($_.Exception.Message)" -foregroundcolor white -backgroundcolor darkred 
        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.

     

    • C 2015 Microsoft Corporation. All rights reserved.
    • Terms of Use
    • Trademarks
    • Privacy Statement
    • [Copied from] v5.6.915.0
    • This page has been extacted by Pete Laker, Microsoft Azure MVP & Microsoft IT Implementer
    X