Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active March 8, 2019 06:19
Show Gist options
  • Save darrenjrobinson/e1db5545c1cbb21ff27a011b97325f14 to your computer and use it in GitHub Desktop.
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/
$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