Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active March 3, 2019 21:07
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/0551104098963c85a6b3a6b1e9ce54a8 to your computer and use it in GitHub Desktop.
Save darrenjrobinson/0551104098963c85a6b3a6b1e9ce54a8 to your computer and use it in GitHub Desktop.
# 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