Active Directory Authentication

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to track down some sample code that I can use to authenticate the
current user against active directory.

I don't want to check their username and password but just want to confirm
that they are actually logged on to the correct AD and then return the groups
that they belong to.

Of course I can get their username quite easily but how can I guarantee that
they are logged onto my AD. Can anyone give me some pointers on where to
start?
 
Pretty simple using the My namespace. Code below:

If My.User.IsAuthenticated Then
If My.User.IsInRole("BUILTIN\Administrators") Then
MsgBox("tsk, tsk... running as Admin are we?")
End If
End If


======================================
David McCarter [Microsoft VB.NET MVP]
www.vsdntips.com
VSDN Tips & Tricks .NET Coding Standards available at:
www.cafepress.com/vsdntips.20412485
 
Back
Top