Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Get Users From Active Directory

$
0
0

Hi,

This is my configuration:

domain xxx.yyyyy

OU - aaaaaaa\bbb

For this configuration I'm trying to get users in that OU. I'm using this code:

            PrincipalContext pctx = new PrincipalContext(ContextType.Domain, "xxx.yyyyy", "OU=bbb,OU=aaaaaaa,DC=xxx,DC=yyyyy");
            GroupPrincipal gpr = GroupPrincipal.FindByIdentity(pctx, "test");
            PrincipalSearchResult<Principal> psr = gpr.GetMembers();

but on the first line I have, an error "There is no such object on the server."

What am I doing wrong ?


Viewing all articles
Browse latest Browse all 31927

Trending Articles