Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create MIM Set
# -- Create Set --
[xml]$SetXML = @'
<!-- Create Set -->
<ResourceOperation operation="Add Update" resourceType="Set" id="SetID">
<AttributeOperation operation="replace" name="DisplayName">__UsersSet</AttributeOperation>
<AttributeOperation operation="replace" name="Description">Set of Users</AttributeOperation>
<AttributeOperation operation="replace" name="Filter" type="filter">/Person[_source = 'PRODAD']</AttributeOperation>
# Get and update SetXML ID
$id = $SetXML | Select-Xml -Xpath "//ResourceOperation[@id='SetID']"
$ = $SetIDName
# Get and update the Set DisplayName
$displayname = $SetXML | Select-Xml -Xpath "//AttributeOperation[@name='DisplayName']"
$displayname.node.'#text' = $SyncRuleIDDisplayName +" Set"
# Get and update the Set Description
$description = $SetXML | Select-Xml -Xpath "//AttributeOperation[@name='Description']"
$description.node.'#text' = "Set for "+$SyncRuleIDDisplayName
# Output SetXML File
# Create the Set
Import-RMConfig -File ($WorkingDirectory[1]+"\NewSet.xml") # -preview -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.