Last active
March 8, 2019 06:19
-
-
Save darrenjrobinson/e1db5545c1cbb21ff27a011b97325f14 to your computer and use it in GitHub Desktop.
Create a SailPoint IdentityNow Access Profile via API with PowerShell. Associated Blog Post https://blog.darrenjrobinson.com/creating-sailpoint-identitynow-access-profiles-via-api-and-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
$orgName = "myOrg" | |
$sourceID = "39012" | |
$profileOwnerID = "12345" | |
# Access Profile Details | |
$accessProfile = @{} | |
$accessProfile.add("name", "My new Access Profile") | |
$accessProfile.add("description", "The New AP") | |
$accessProfile.add("sourceId", $sourceID) | |
$accessProfile.add("ownerId", $ownerID) | |
# Access Profile Entitlements | |
$entitlements = @() | |
$entitlements += "2c91808368c413841268c833031e2477" | |
$entitlementsToAdd = @{"entitlements" = $entitlements} | |
$accessProfile.add("entitlements", $entitlementsToAdd.entitlements) | |
# Access Profile Type | |
$accessProfile.add("approvalSchemes", "manager") | |
$accessProfile.add("requestCommentsRequired", $true) | |
$accessProfile.add("deniedCommentsRequired", $true) | |
$accessProfileBody = $accessProfile | convertto-json | |
# Create Access Profile | |
$newAccessProfile = Invoke-RestMethod -Uri "https://$($orgname).api.identitynow.com/v2/access-profiles/" -Method Post -Headers @{Authorization = "$($v3Token.token_type) $($v3Token.access_token)"; "Content-Type" = "application/json"} -Body $accessProfileBody | |
$newAccessProfile | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment