PowerShell MIM 2016 Run Profile

This is a quick PowerShell script to run a specific profile on a MIM 2016 agent.  To note this assumes you have MIM 2016 Sync Services installed, and you are running this from that server.  This will ideally help you setup a scheduled task for running profiles.

##Get the Agents currently setup on the local MIM Sync Server
$mimAgents = Get-WMIObject -Class "MIIS_ManagementAgent" -NameSpace "root\MicrosoftIdentityIntegrationServer";

##Defined Agent Name and Profile to be ran
$adAgentName = "ADAgent";
$profileToRun = "FullImport"

foreach($agent in $mimAgents){
    $agentName = $agent.Name;
    if($agentName -match $adAgentName){
        ##Run defined Profile
        $process = $agent.Execute($profileToRun);
    }
}

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s