Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active March 8, 2019 06:17
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/204cca2000558e6f01a50bda7c2c29e2 to your computer and use it in GitHub Desktop.
Save darrenjrobinson/204cca2000558e6f01a50bda7c2c29e2 to your computer and use it in GitHub Desktop.
# IdentityNow Orgname
$orgname = "yourOrg"
# Access Profiles
$GetProfilesListBaseURI = "https://$($orgName).api.identitynow.com/v2/access-profiles"
# Update Profile
$UpdateProfilesListBaseURI = "https://$($orgName).api.identitynow.com/v2/access-profiles"
# Get Profile Entitlements
$GetProfileEntitlementsBaseURI = "https://$($orgName).api.identitynow.com/v2/access-profiles"
# Existing Profiles
$existingProfiles = Invoke-RestMethod -method Get -uri $GetProfilesListBaseURI -Headers @{Authorization = "$($v3Token.token_type) $($v3Token.access_token)"}
write-host -ForegroundColor green "$($existingProfiles.Count) Profiles found"
foreach ($profile in $existingProfiles){
write-host -ForegroundColor Yellow "For profile $($profile.description), approval is $($profile.approvalSchemes) and requestable is $($profile.requestable)"
# Get Profile Entitlments
$profileEntitlements = Invoke-RestMethod -method Get -uri "$($GetProfileEntitlementsBaseURI)/$($profile.id)/entitlements" -Headers @{Authorization = "$($v3Token.token_type) $($v3Token.access_token)"}
foreach ($entitlement in $profileEntitlements){
write-host -ForegroundColor Cyan "$($profile.description) has entitlement $($entitlement.description) from $($entitlement.applicationName)"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment