UI Solution:
If you are trying to get get to the data for reviewing manually, when you run your report, download the report “Include Access Details”
This will give you a CSV file that you can download and manipulate in Excel to get the required data:
RestAPI
If you are trying to do something programmatically, you can get a little closer using the /search API:
This query will give you the fields you are looking for but will include all accounts:
{
"indices": [
"identities"
],
"query": {
"query": "attributes.cloudLifecycleState:Inactive AND @accounts(source.name:\"Active Directory\" AND disabled:\"false\")",
"fields": null
},
"queryResultFilter": {
"includes": [
"accountId",
"name",
"firstName",
"lastName",
"attributes.cloudLifecycleState",
"attributes.endDate",
"accounts.id",
"accounts.name",
"accounts.disabled",
"accounts.source.name"
]
}
}
The results will look like:
Another option if you are mostly interested in the account data would be to use innerHit. This will limit the data to only the for the AD accounts:
type or paste code here{
"indices": [
"identities"
],
"query": {
"query": "attributes.cloudLifecycleState:Inactive AND @accounts(source.name:\"Active Directory\" AND disabled:\"false\")",
"fields": null,
"innerHit": {
"query": "source.name:\\\"Active Directory\\\"",
"type": "accounts"
}
}
}
The results will look like:
Unfortunately, you can use queryResultFilters and innerHit at the same time. Although, you could programmatically do this by running both queries and merging the result sets.
If your end goal is a csv or is more complicated (like wanting to automatically disable these accounts or other API calls), you might look at using the SDK.
There is a video to get started:
Here is the documentation: Search with the PowerShell SDK | SailPoint Developer Community
From the SDK, you can get your results, process the data, and export the data directly to a CSV or process it in other ways.