Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do you Authenticate a User against The Active Directory

Posted on 2004-09-16
2
Medium Priority
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1500 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

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…
Check out what's been happening in the Experts Exchange community.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

721 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