G
Guest
Hi,
I am trying to determine of which groups a particular user is a member. I
am using the following code:
DirectorySearcher search = new DirectorySearcher();
search.Filter = String.Format("(SAMAccountName={0})", userName);
search.PropertiesToLoad.Add("memberOf");
SearchResult result = search.FindOne();
I get no errors for any user I try. The problem is certain users have the
"memberOf" property and others don't. However, when I look in AD, every user
I try has groups listed in the "Member Of" tab of the properties of that
user.
Any ideas why "memberOf" property would come through for some users and not
others?
Is there a setting in AD that might be causing the issue?
Thanks in advance,
-Pete
I am trying to determine of which groups a particular user is a member. I
am using the following code:
DirectorySearcher search = new DirectorySearcher();
search.Filter = String.Format("(SAMAccountName={0})", userName);
search.PropertiesToLoad.Add("memberOf");
SearchResult result = search.FindOne();
I get no errors for any user I try. The problem is certain users have the
"memberOf" property and others don't. However, when I look in AD, every user
I try has groups listed in the "Member Of" tab of the properties of that
user.
Any ideas why "memberOf" property would come through for some users and not
others?
Is there a setting in AD that might be causing the issue?
Thanks in advance,
-Pete