How to correctly use okta-sdk-dotnet ListUserGroups method?

This link takes you to the Okta SDK IUsersClient method ListUserGroups. I have a user ID that I am passing into the method but I’m not sure what to do with what is being returned. Example:

ICollectionClient<IGroup> oktaGroups = client.Users.ListUserGroups(oktaUserId);

What do I do with oktaGroups after the method runs in order to get the names of the groups?

Hi @npaulson

You can use something like the following to list the group names.

var grps = client.Users.ListUserGroups("00uozbgc03wzqoaXp2p6").ToEnumerable();

foreach(var grp in grps)

Thanks for that, I haven’t used ToEnumerable before so I wasn’t sure what to do with it.