HighTechTalks DotNet Forums  

Checking group membership

ASP.net Security microsoft.public.dotnet.framework.aspnet.security


Discuss Checking group membership in the ASP.net Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jan Nielsen
 
Posts: n/a

Default Checking group membership - 09-02-2003 , 03:07 PM






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



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.