Last active
October 30, 2018 05:51
-
-
Save darrenjrobinson/178f11dc85f26545442030b91ddc0dcb to your computer and use it in GitHub Desktop.
Manage SailPoint IdentityNow Governance Group Membership. Associated Blog Post can be found here https://blog.darrenjrobinson.com/managing-sailpoint-identitynow-governance-groups-via-the-api-with-powershell/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ID of the Governance Group that we just created | |
$createGovGroup.id | |
# Get GROUP MEMBERS to add | |
$query = "darren" | |
$govGroupMembers = Invoke-RestMethod -Method GET -Uri "$($SearchURI)limit=$($searchLimit)&query=$($query)" -Headers @{Authorization = "Basic $($encodedAuth)" } | |
$govGroupMembers = $govGroupMembers | Sort-Object | Select-Object -Property id -Unique | |
$govGroupMembers.Count | |
$add=@() | |
$remove=@() | |
# Add members | |
foreach ($member in $govGroupMembers){ | |
$add += $member.id | |
} | |
$govGroupsMembers =@{ | |
add = $add | |
remove = $remove | |
} | |
$govGroupsMembersBody = $govGroupsMembers | ConvertTo-Json | |
# GovernanceGroup Update URI | |
$govGroupMembersURI = "https://$($orgName).api.identitynow.com/v2/workgroups/$($createGovGroup.id)/members" | |
# Update Goverance Group | |
Invoke-RestMethod -Uri $govGroupMembersURI -Method POST -Body $govGroupsMembersBody -Headers @{Authorization = "Basic $($encodedAuth)"; "content-type" = "application/json"} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment