group-membership

Enumeration of nested AD user groups using C#

人盡茶涼 提交于 2019-12-21 05:14:10
问题 I've written some code that gets all users of groups and nested groups. I also wanted to make sure that looping did not happen if the group membership caused a loop by having the first group a member of the last group. The code I wrote works OK but is a little slow. This is the first time I've tried to do AD look-ups. Could someone take a look and tell me if the code looks OK or bad-coding (or worse), or I've gone about it the wrong way? using System; using System.Collections.Generic; using

Check active directory group membership recursively

五迷三道 提交于 2019-12-04 19:29:45
问题 So I have a question regarding recursive groups in active directory. I have a little method that checks if a user id is in a group or not. Works great. Found out today that it doesn't check recursive group membership and I'm not too sure how (or if) there is a way to do that. Here's what I have so far for non-recursive: public static bool CheckGroupMembership(string userID, string groupName, string Domain) { bool isMember = false; PrincipalContext ADDomain = new PrincipalContext(ContextType

Enumeration of nested AD user groups using C#

帅比萌擦擦* 提交于 2019-12-03 16:21:45
I've written some code that gets all users of groups and nested groups. I also wanted to make sure that looping did not happen if the group membership caused a loop by having the first group a member of the last group. The code I wrote works OK but is a little slow. This is the first time I've tried to do AD look-ups. Could someone take a look and tell me if the code looks OK or bad-coding (or worse), or I've gone about it the wrong way? using System; using System.Collections.Generic; using System.Text; using System.DirectoryServices; using System.IO; namespace Tester3 { class Program3 {

Check active directory group membership recursively

为君一笑 提交于 2019-12-03 12:16:17
So I have a question regarding recursive groups in active directory. I have a little method that checks if a user id is in a group or not. Works great. Found out today that it doesn't check recursive group membership and I'm not too sure how (or if) there is a way to do that. Here's what I have so far for non-recursive: public static bool CheckGroupMembership(string userID, string groupName, string Domain) { bool isMember = false; PrincipalContext ADDomain = new PrincipalContext(ContextType.Domain, Domain); UserPrincipal user = UserPrincipal.FindByIdentity(ADDomain, userID); if (user