Using PowerShell to display the value of the ERL attribute of a group
Summary To synchronize an object to a target data source, the object must have a populated ERL attribute. The values of this attribute are used by the synchronization engine to locate the appropriate outbound synchronization rules that need to be applied to an object during a synchronization run. The script code below displays the expectedRulesList attribute value of a group and the status of the relationship between the object and the outbound synchronization rule. When calling the script, you need to provide the display name of the object as parameter. #---------------------------------------------------------------------------------------------------------- set-variable -name URI -value "http://localhost:5725/resourcemanagementservice" -option constant #---------------------------------------------------------------------------------------------------------- function ShowEREName { PARAM($objectId) END { $exportObject = export-fimconfig -uri $URI ` –onlyBaseResources ` -customconfig "ExpectedRuleEntry[ObjectID='$objectId']" if($exportObject -eq $null) {write-host " -$($objectId)"} else { $displayName = $exportObject.ResourceManagementObject.ResourceManagementAttributes | ` Where-Object {$_.AttributeName -eq "DisplayName"} $status = $exportObject.ResourceManagementObject.ResourceManagementAttributes | ` Where-Object {$_.AttributeName -eq "SynchronizationRuleStatus"} write-host " -$($displayName.Value), $($status.Value)" } } } #---------------------------------------------------------------------------------------------------------- if($args.count -ne 1) {throw "Missing name parameter"} $objectName = $args[0] write-host $objectName if(@(get-pssnapin | where-object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {add-pssnapin FIMAutomation} $exportObject = export-fimconfig -uri $URI ` –onlyBaseResources ` -customconfig "Group[DisplayName='$objectName']" if($exportObject -eq $null) {throw "L:Object not found"} $erlAttribute = $exportObject.ResourceManagementObject.ResourceManagementAttributes | ` Where-Object {$_.AttributeName -eq "ExpectedRulesList"} if($erlAttribute -eq $null) {throw "L:The expected rules list doesn't have values"} foreach($erlValue in $erlAttribute.values) {ShowEREName -objectId ($erlValue.split(":"))[2]} write-host "`n" #---------------------------------------------------------------------------------------------------------- trap { $exMessage = $_.Exception.Message if($exMessage.StartsWith("L:")) {write-host "`n" $exMessage.substring(2) "`n" -foregroundcolor white -backgroundcolor darkblue} else {write-host "`nError: " $exMessage "`n" -foregroundcolor white -backgroundcolor darkred} Exit } #---------------------------------------------------------------------------------------------------------- Go to the FIM ScriptBox
November 5th, 2009 4:19am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics