Last active
March 3, 2019 21:07
-
-
Save darrenjrobinson/0551104098963c85a6b3a6b1e9ce54a8 to your computer and use it in GitHub Desktop.
Get the Entitlements for a SailPoint IdentityNow Source. Associated blogpost https://blog.darrenjrobinson.com/searching-and-returning-sailpoint-identitynow-entitlements-using-the-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
# IdentityNow Orgname | |
$orgName = "myOrgname" | |
# Get IdentityNow Sources | |
$IDNSources = Invoke-RestMethod -Method Get -Uri "https://$($orgName).api.identitynow.com/cc/api/source/list" -Headers @{Authorization = "Basic $($encodedAuth)" ;"content-type" = "application/json"} | |
write-host -ForegroundColor Green "$($IDNSources.Count) Sources found" | |
$utime = [int][double]::Parse((Get-Date -UFormat %s)) | |
# Get Source Entitlements | |
foreach ($idnSource in $IDNSources) { | |
$entitlementsURI = "https://$($orgName).api.identitynow.com/cc/api/entitlement/list?_dc=$($utime)&CISApplicationId=$($idnSource.externalId)" | |
$sourceEntitlements = Invoke-RestMethod -Method Get -uri $entitlementsURI -Headers @{Authorization = "$($v3Token.token_type) $($v3Token.access_token)" ; "Content-Type" = "application/json"} | |
Write-Host -ForegroundColor green "$($sourceEntitlements.items.Count) entitlements retured for Source $($idnSource.description)" | |
$myEntitlement = $sourceEntitlements.items | Select-Object | Where-Object {$_.displayName -like "*SYD*"} | |
$myEntitlement | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment