Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create SailPoint IdentityNow Governance Group
$baseURI = "https://$($orgName).api.identitynow.com"
# Governance Group Owner
$query = "darrenrobinson_admin"
$Accounts = Invoke-RestMethod -Method GET -Uri "$($SearchURI)limit=$($searchLimit)&query=$($query)" -Headers @{Authorization = "Basic $($encodedAuth)" }
$Accounts.Count
$GovGroupOwner = $Accounts[0]
$body = @{"name" = "Vendor - Darren J Robinson";
"displayName" = "Darren J Robinson";
"description" = "Darren J Robinson";
"owner" = @{"displayName" = $GovGroupOwner.displayName;
"emailAddress" = $GovGroupOwner.email;
"id" = $GovGroupOwner.id;
"name" = $GovGroupOwner.name
}
}
$body = $body | Convertto-json
try{
$createGovGroup = Invoke-RestMethod -Method POST -Uri "$($baseURI)/v2/workgroups?&org=$($orgName)" -Headers @{Authorization = "Basic $($encodedAuth)"} -Body $body
if ($createGovGroup.memberCount.Equals(0)){
write-host -ForegroundColor Green "Created Governance Group"
}
} catch {
write-host -ForegroundColor Red "Problem creating Governance Group"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment