Checking group membership

J

Jan Nielsen

In ASP.Net I'm trying to check for some users membership of a group.
The user is not nessicerily the user requesting the page, and I do not have
the users password.

So far I've created the following piece code:

DirectoryEntry group = new DirectoryEntry(FormatAdsiSyntax(strGroup) +
",group", "domain\\user", "password");
Object q = group.Invoke("IsMember", new object[]
{FormatAdsiSyntax(strUserID)});
if (q.Equals(false))
{
// ......
}

The function FormatAdsiSyntax simply returns a string like:
WinNT://domain/objectname
The user and password supplied is an account operator in the domain.

On my Windows XP workstation this piece of code works all right, even though
it's pretty slow.
But on a Windows 2000 Server an exception occours in the "Invoke" code line,
saying "The network path was not found".

Shouldn't this work on Win2K also ?

Can I somehow make this group membership check in another and faster way ?
(We'll not be upgrading to a 2003 Server AD until the beginning of next
year).



Thanks in advance,
Jan Nielsen
 

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

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,228
Latest member
MikeMichal

Latest Threads

Top