Using PowerShell to start a run profile
#--------------------------------------------------------------------------------------------------
set-variable -name MaName -value "<MA NAME>" -option constant
set-variable -name ProfileName -value "<RUN PROFILE NAME" -option constant $curMA = @(get-wmiobject -class "MIIS_ManagementAgent"` -namespace "root\MicrosoftIdentityIntegrationServer"` -computername "."` -filter "Name='$MaName'")
if($curMA.count -eq 0){throw "MA not found"}
write-host "`nStarting $ProfileName on $MaName"
write-host "Result: $($curMA[0].Execute($ProfileName).ReturnValue)`n"
#--------------------------------------------------------------------------------------------------
trap
{
Write-Host "`nError: $($_.Exception.Message)`n" -foregroundcolor white -backgroundcolor darkred
Exit
}
#--------------------------------------------------------------------------------------------------
Markus Vilcinskas, Knowledge Engineer, Microsoft Corporation
November 6th, 2009 11:51pm