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
 

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

Back
Top