Jorge's Quest For Knowledge!

All You Need To Know About Identity And Security On-Premises And In The Cloud. It's Just Like An Addiction, The More You Have, The More You Want To Have!

(2009-08-05) FIM – Using PowerShell To Determine The ERL Configuration

Posted by Jorge on 2009-08-05


Info/Script by: Markus Vilcinskas, Technical Content Developer, Microsoft Corporation

Source: http://social.technet.microsoft.com/Forums/en-US/ilm2/thread/75ab09f9-0bb1-4a53-b091-803bdc4f1f61

 

#-------------------------------------------------------------------------------------------------------------------------- write-host "`nERL Flow Configuration" write-host "======================" #-------------------------------------------------------------------------------------------------------------------------- $lstMA = @(get-wmiobject -class "MIIS_ManagementAgent" -namespace "rootMicrosoftIdentityIntegrationServer" -computername "." -filter "Type='Identity Lifecycle Management (ILM)'") if($lstMA.count -eq 0) {throw "There is no ILM MA configured"} #-------------------------------------------------------------------------------------------------------------------------- $ilmMAName = $lstMA[0].Name $targetFile = (split-path -path $MyInvocation.MyCommand.Definition -parent) + "temp.xml" if(test-path $targetFile) {remove-item $targetFile} $csExportPath = ((Get-ItemProperty "hklm:SYSTEMCurrentControlSetServicesmiiserverParameters").Path) + "BinMaExport.exe" $startinfo=new-object diagnostics.processstartinfo $startinfo.filename = $csExportPath $startinfo.arguments = """$ilmMAName""" + " " + """$targetFile""" $startinfo.UseShellExecute = $false $startinfo.CreateNoWindow = $true $process=[Diagnostics.Process]::Start($startinfo) $process.WaitForExit() #-------------------------------------------------------------------------------------------------------------------------- [System.Xml.XmlDocument]$xmlDoc = get-content $targetFile write-host "ILM MA:" $ilmMAName $attributeName = "managed:ExpectedRulesList" $attributeName = "expectedRulesList" write-host "Person:" ($xmlDoc.selectNodes("//import-flows[@mv-attribute='$attributeName']/ import-flow[@cd-object-type='Person']").count -eq 1) write-host "Group :" ($xmlDoc.selectNodes("//import-flows[@mv-attribute='$attributeName']/ import-flow[@cd-object-type='Group']").count -eq 1) write-host "" if(test-path $targetFile) {remove-item $targetFile} #-------------------------------------------------------------------------------------------------------------------------- trap { Write-Host "`nError: $($_.Exception.Message)`n" -foregroundcolor white -backgroundcolor darkred Exit } #--------------------------------------------------------------------------------------------------------------------------

 

Cheers,

Jorge

———————————————————————————————

* This posting is provided "AS IS" with no warranties and confers no rights!

* Always evaluate/test yourself before using/implementing this!

* DISCLAIMER: https://jorgequestforknowledge.wordpress.com/disclaimer/

———————————————————————————————

############### Jorge’s Quest For Knowledge #############

######### http://JorgeQuestForKnowledge.wordpress.com/ ########

———————————————————————————————

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

 
%d bloggers like this: