Hello ,
I am writing a PowerShell Script that will generate a .csv file of identities with attributes “stale = true”.
This script is giving me only 250 identities but there are more than 1000 identities with this attribute being true.
$SearchURL = "https://sailpoint.api.identitynow.com/beta/search"
$searchHeaders = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$searchHeaders.Add("Content-Type", "application/json")
$searchHeaders.Add("Accept", "application/json")
$searchHeaders.Add("Authorization", "Bearer $accessToken")
$searchBody = '{
"indices": [
"identities"
],
"query": {
"query": "attributes.stale:True",
"fields": [
"displayName"
]
}
}'
$searchResp = Invoke-RestMethod $SearchURL -Method 'POST' -Headers $searchHeaders -Body $searchBody
$Output = foreach ($data in $searchResp) {
New-Object -TypeName PSObject -Property @{
name = $data.displayName
staffId = $data.attributes.staffId
} | Select-Object name, staffId
}
$Output
Could anyone tell what am I missing here to get all identities.