Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a Form to set LDAP Query

Status
Not open for further replies.
Joined
Apr 5, 2005
Messages
1,484
Location
US
I'm currently research and looking for an answer.
I'm building an Admin web page that will do the following:
-Allow an administrator to enter the sAMAccount of a user.
-Click Submit
-VBScript will report last time user logged in.

So far I have the VBScript works. The issue is the Set objUser is hardcoded. example:
Set objUser = GetObject _
("LDAP://cn=johnDoe,OU=HR,dc=domain,dc=com")

What I would like to accomplish when the Admin enters the users logon name in the Form, is to have it search AD for the user the report on the LastLogon.

I've been looking at using the LDAP query of:
(&(&(objectCategory=Person)(objectClass=User))(sAMAccountName=strUserName))
Don't know if I'm on the right track.

Any assitance appreciated...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top