Solved

How do you Authenticate a User against The Active Directory

Posted on 2004-09-16
2
211 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

943 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

11 Experts available now in Live!

Get 1:1 Help Now