|
|
|
start date: Thu, 23 Aug 2007 04:54:18 -0700,
posted on: microsoft.public.dotnet.languages.csharp
back
| Thread Index |
|
1
Pete Wittig
|
|
2
Pete Wittig
|
Active Directory Properties not loading....
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
Date:Thu, 23 Aug 2007 04:54:18 -0700
Author:
|
RE: Active Directory Properties not loading....
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.
"Pete Wittig" wrote:
> 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
Date:Thu, 23 Aug 2007 06:26:02 -0700
Author:
|
|
|