Checking group membership

Discussion in 'ASP .Net' started by Jan Nielsen, Sep 2, 2003.

  1. Jan Nielsen

    Jan Nielsen Guest

    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
     
    Jan Nielsen, Sep 2, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cameron

    User Group Membership

    cameron, Jun 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,147
    John Saunders
    Jun 10, 2004
  2. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    best way of checking for Group membership?

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, Feb 26, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    286
    =?Utf-8?B?ZGhucml2ZXJzaWRl?=
    Feb 26, 2005
  3. Replies:
    7
    Views:
    583
    Tim Golden
    Feb 16, 2007
  4. Tino Donderwinkel
    Replies:
    2
    Views:
    824
    Tino Donderwinkel
    Jun 18, 2008
  5. Raterus

    Getting Group Membership

    Raterus, Sep 9, 2004, in forum: ASP .Net Security
    Replies:
    2
    Views:
    128
    Raterus
    Sep 10, 2004
Loading...

Share This Page