Last active
October 30, 2018 05:50
-
-
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/
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
$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