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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User credentials with LDAP query in ASP?

Status
Not open for further replies.

markdmac

MIS
Dec 20, 2003
12,340
0
0
US
Hi All,

I've written some ASP pages that grab the current users name and then enumerates some of the users properties from AD.

I'm using Request.ServerVariables("REMOTE_USER") to get the user name. I'm then doing a query to find that users distinguishedName, so I have to do a series of GetObject commands like this one:


Code:
Set cont = GetObject("LDAP://OU=SBSUsers,OU=Users,OU=MyBusiness,DC=mycompany,DC=local")
When logged on as administrator this works great, but when logged on as a user it fails. I need to specify the administrator credentials to use in my queries but I'm not sure how to do that. Can anybody point me in the right direction?

Thanks in advance.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
try something like this:

objLdap = GetObject("LDAP:")
objADSIuser = objLdap.OpenDSObject(strLDAPCommand, strAdminUser, strAdminPassword, ADS_AUTHENTICATION_ENUM.ADS_SECURE_AUTHENTICATION)


Mark

 
Many thanks.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top