Solved

How do you Authenticate a User against The Active Directory

Posted on 2004-09-16
2
210 Views
Last Modified: 2010-04-13
I am writting a program using VBA and I want to know if there is a way to Authenticate a user against the Active Directory.  I would like the program to be able to have the user enter there username and password for the Domain and my program verify this data against the AD.
0
Comment
Question by:Alford-Miller
2 Comments
 
LVL 17

Expert Comment

by:Jared Luker
ID: 12078940
Sounds like you should ask this in the programming section...
0
 
LVL 16

Accepted Solution

by:
JamesDS earned 500 total points
ID: 12079374
Alford-Miller

This is VBscript Code, but it should do what you want:

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Create connection to AD with authorised user account.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    strAuthUser            = "ADministrator"                                                ' Authorised user account name. Needs at least Domain Admin rights
    strAuthPassword        = "Pa55word"                                                ' Authorised user account password
    strAuthOUPath        = "ou=UsersAdmin"    ' Distinguished Name of OU containing Authorise User Account

sub AuthoriseOperation()

    ' Authenticate User
    Set oRoot    = GetObject("LDAP:")
    Set oOU        = oRoot.OpenDSObject("LDAP://dc=YOURDOMAIN, dc=COM", "cn="&strAuthUser&", "&strAuthOUPath, strAuthPassword, ADS_SECURE_AUTHENTICATION)
   
end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

You can alter the code to accept input from the user for username and password

Cheers

JamesDS
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now