Export Users via Orchestrator API

Hi

I’m trying to create an export of users on “Organization level”, for an On-Prem environment, through API calls.

The Endpoint…

GET /odata/users

…gives me Users assigned to the Orchestrator Tenant, but not all users present in the Organization (Accounts & Groups).

I thought this endpoint might give me the result, but I’m getting 400 Bad Request, even when running through the Orchestrator Swagger UI.

GET /api/DirectoryService/SearchForUsersAndGroups?searchContext=Users

Any suggestions?

I know its called “Orchestrator API” (and therefore might be limited to this product), but how would you export all users to see Group memberships etc.?

Regards
Soren

It seems like you’re using the /api/DirectoryService/SearchForUsersAndGroups endpoint, but it might be returning a 400 error due to an issue with the query parameters. Try using searchContext=All instead of Users to get both users and groups:

GET /api/DirectoryService/SearchForUsersAndGroups?searchContext=All

If this still doesn’t work, consider querying Active Directory directly using PowerShell or LDAP to fetch all users and group memberships. For example, you can use PowerShell to get users and their groups like this:

Get-ADUser -Filter * -Property MemberOf | Select-Object Name, MemberOf

Alternatively, if you’re just looking for users in Orchestrator, use the /odata/users and /odata/groups endpoints to fetch users and group info, then map them manually.

Hope that helps!

Changing the parameter to…

searchContext=All

…does not work unfortunately - excact same error.

Active Directory is not provided as an identity provider for the organization.
And I believe the PowerShell command fetches AD-users and is not related to UiPath Org?

/odata/users is not giving the desired output as I wrote in the initial post.
/odata/groups does not exist??

GPT response?