Public/get-AllegisIDNIdentityList.ps1

1
2
3
4
5
6
7
8
9
10
11
function get-AllegisIDNIdentityList ($orgname, $accesstoken, $query){
    $header=get-AllegisIDNprivateHeader $accesstoken
    $baseurl="https://$orgname.api.identitynow.com"
    $dc='1555349479358'
    $filters="{`"joinOperator`":`"OR`",`"filter`":[{`"property`":`"name`",`"value`":`"$query`"},{`"property`":`"alias`",`"value`":`"$query`"},{`"property`":`"email`",`"value`":`"$query`"}]}"
    $urlquery=""
    $url="$baseurl/cc/api/user/list?_dc=$dc&query=$query&filters=$filters&limit=100&page=1&start=0&sorters=%5B%7B%22property%22%3A%22name%22%2C%22direction%22%3A%22ASC%22%7D%5D"
    $response=Invoke-WebRequest -UseBasicParsing -Uri $url -Headers $header -Method Get
    $identitylist=$response.Content | ConvertFrom-Json
    return $identitylist
}