Instantly share code, notes, and snippets.

Embed
What would you like to do?
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/
# 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