Active Directory Properties not loading....

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
 
G

Guest

I found the problem. It was a security setting for particular users who
where created after we switched domains. Authenticated Users did not have
read permission on certain accounts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top