Does anyone have a PowerShell script or form that allows a user to search for members of a specific role, access profile, or entitlement, and return the results to them?
I don’t have a pseudo code for that, but you can achieve it by using
- SailPoint APIs in PS scripts. Either use Search search-post | SailPoint Developer Community and add a query like @access*(name:“Test Access Item Name”)* or an access item specific API. For example, to get list of identities assigned to a role use get-role-assigned-identities | SailPoint Developer Community or Search. This Search Role Members - #8 by phil_awlings may be a good starting point to write the scripts.
- Using Form. Select field > Search option type in Form. It has a limitation to choose either one of role, access profile or entitlements. So you need to build a form with all the options in a different section.
Hi Keiran
I have developed a HTML form Page where i am using the JavaScript → Logic, API calls, to fetch the details what you’re expecting.
Regards
SathishKumar.N
hi @keiranc ,
I have below code:
$headers = New-Object “System.Collections.Generic.Dictionary[[String],[String]]”
$headers.Add(“Content-Type”, “application/json”)
$headers.Add(“Accept”, “application/json”)
$headers.Add(“Authorization”, “Bearer ”)
$body = @"
{
"indices
": [
"identities
"
],
"query
": {
"query
": "@access(name:
`“entitlement_name OR access_profile name OR Role_name\
”)`"
}
}
"@
$response = Invoke-RestMethod ‘https://{{tenant}}.api.identitynow.com/v2025/search’ -Method ‘POST’ -Headers $headers -Body $body
$response | ConvertTo-Json