Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active October 30, 2018 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenjrobinson/590b2741af3a24caed33b2fe02095e85 to your computer and use it in GitHub Desktop.
Save darrenjrobinson/590b2741af3a24caed33b2fe02095e85 to your computer and use it in GitHub Desktop.
Create SailPoint IdentityNow Governance Group. Associated Blog Post can be found here https://blog.darrenjrobinson.com/managing-sailpoint-identitynow-governance-groups-via-the-api-with-powershell/
$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