I have an attribute in my environment called “primaryrolename” that describes our job titles. I am trying to use a search or a function in AIC to get a list of every primaryrolename in my environment. So far I haven’t been able to figure it out and am not getting any answers from Harbor Pilot. Can anyone help?
Hi Jared,
You can do that with script. This is how I would have done. But there may be other options. Use python or powershell script depending on your preference. This is how I would have done using python script.
- List all identities using API and save it in a list.
- Loop each identity, and fetch attribute
“primaryrolename”
from each identity and append it in a new list,resultList
. - After the loop ends, you can remove duplicates from the
resultList
. The final data has all the jobtitles.
Thanks.
How many identities do you need to look at? If it’s fewer than 10,000, you could get all the data in a single JSON object using search via the API using a queryResultFilter
.
Do you already have Postman set up to query the API?
Hi Jared,
following up on my earlier reply, if you have the ability to run Searches against the API, then use this POST body (you can change the query.query to match all the identities whose titles you care about, if you want to include identities other than just the active ones:
{
"indices": ["identities"],
"query": {
"query": "attributes.cloudLifecycleState:active"
},
"includeNested": false,
"sort": [ "id" ],
"queryResultFilter": {
"includes": [ "attributes.primaryRoleName" ]
}
}
If you have 10,000 or fewer active identities, you’ll get all the results in one page if you set the limit
HTTP query param to 10000
.
This blog post I wrote explains Identity Search in more detail, if you want to understand the advice.
If this is a one-time thing, just run a search for all identities, add the “primaryrolename” column to the results and export the data. Then open the file in Excel, isolate that column and run the “Remove Duplicates” operation in the “Data” menu.
If you already have the PowerShell SDK configured against the environment, this is another alternative (one-liner):
Invoke-Paginate -Function "Get-V2024Identities" -Parameters @{"XSailPointExperimental"="$true"} | Select -property @{Name="country"; expression={$_.attributes.country}} -unique
Hey Kevin,
This seems to be the simplest option. It is a one time thing, but I could also save and/or schedule this search if it wasn’t. Thanks for the help!
Thanks for the help Kapil!
Thanks for your suggestion Terry!
My name is Vip, but I appreciate the gratitude nonetheless
Hey Vinpinjeet,
I appreciate your help on this. It’s a one time thing and it looks like just filtering on the attribute and using excel to remove dupes is the simplest answer. I will try this out any though for the practice!