Re: Network Path not found
From: Willy Denoyette [MVP] (willy.denoyette@pandora.be)
Date: 09/06/02
- Next message: TimmyG: "Please explain loss of token between web server box and sql box"
- Previous message: Parker Zhang [MS]: "RE: EventLog Permissions"
- In reply to: Albert Waelti: "Network Path not found"
- Next in thread: Gary: "RE: Network Path not found"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Willy Denoyette [MVP]" <willy.denoyette@pandora.be> Date: Fri, 6 Sep 2002 12:37:26 +0200
Don't use DirectoryServices/ADSI for this, use Windows Authentication and WebServer.User.IsInrole to check group membership.
Willy.
"Albert Waelti" <albert.waelti@gmx.net> wrote in message news:12fe401c2557a$ac5296e0$39ef2ecf@TKMSFTNGXA08...
> Hi,
>
> I'd like to test if a user belongs to the
> group "MyGroupName" and I used the
> following code, but I always get the error "Network Path
> not found.". What's
> wrong ?
> I'm using ASP.NET.
>
> ============================================
> Dim oDirNTRoot As DirectoryEntry = New
> DirectoryEntry("WinNT://MyDomain/computer", sUsername,
> sPassword)
>
> Dim oUserDir As DirectoryEntry = oDirNTRoot.Children.Find
> (sUsername, "user")
> Dim oGroupDir As DirectoryEntry = oDirNTRoot.Children.Find
> ("MyGroupName",
> "group")
>
> Dim bIsGroupMember As Boolean = False
> If oGroupDir.Name <> "" Then
> bIsGroupMember = oGroupDir.Invoke("IsMember", New
> Object()
> {oUserDir.Path.ToString()})
> End If
>
> ============================================
>
> Are there other ways to do this using LDAP ?
>
> Thanks in advance
>
> Albert
>
>
- Next message: TimmyG: "Please explain loss of token between web server box and sql box"
- Previous message: Parker Zhang [MS]: "RE: EventLog Permissions"
- In reply to: Albert Waelti: "Network Path not found"
- Next in thread: Gary: "RE: Network Path not found"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|