how can I get the group of user?
C# get group of user
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
how can I get the group of user?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Md Tahmidul AbedinRank #443 · 5.7K reputationPosted Mar 20, 2023, 1:19 AM EDT
Hi gabriela gonzalez,
To get SharePont group users using (C#) CSOM, you can follow the bellow code
private void getGroupUser(ClientContext clientContext) { GroupCollection groups= clientContext.Web.SiteGroups; Group group= groups.GetById(); UserCollection users= group.Users; clientContext.Load(users); clientContext.ExecuteQuery(); foreach (User user in users) { Console.WriteLine("User: {0} Email: {2} Login Name: {3}", user.Title, user.Email, user.LoginName); } }Jignesh KumarRank #91 · 22.9K reputationPosted Jan 4, 2023, 11:00 PM EST
Hello,
Please use these links,
https://social.msdn.microsoft.com/Forums/vstudio/en-US/516a40c5-1385-4f84-99af-b7cdf15b3e9d/i-want-to-get-all-the-ad-groups-a-user-is-a-member-of-using?forum=csharpgeneral
https://www.c-sharpcorner.com/blogs/aad-group-read-member-summary-using-csharp