How to Get groups that users belong to using API or PowerShell

I need to get al groups details for the all the users listed in CSV file.

User A → GroupB,GroupC, GroupF
User B–> GroupA, GroupD

You will want to iterate over each user in your CSV and make an API request to GET /api/v1/users/{{userId}}/groups for each user, which will get you the groups the specified user is a member of.

Hi Andrea,

Thanks for update , but i need to get 8k users group details, all the users/userid are in CSV file .

Is there any other way we can export the 8k users groups (Okta groups only) to .csv ?

Not directly, but you could likely either use Postman Runner or a script to help you get his information. If you’re code savvy, we have a slew of Management SDKs that you can use, which you can see listed here: Okta, Inc · GitHub