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

LDAP bind user to objUser

Status
Not open for further replies.

fresod

IS-IT--Management
Sep 26, 2006
4
NO
Hi.

I want the user to be able to change his/hers password trough LDAP. But I`m having trouble to bind the user to objUser. I`ve tried this:

Set objUser = GetObject("LDAP://cn=USERS NAME,ou=OU, dc=DOMAIN,dc=COM")

but how can I get the USERS NAME of a logged user? I can get the sAMAccountName trough request.servervariables("auth_user") but I dont think I can bind a user to objUser with sAMAccountName.


Any suggestions?
 
Try this instead.
[tt]
dim ouser, otrans, sdn
set ouser=nothing
if request.servervariables("auth_user")<>"" then
with server.createobject("nametranslate")
.init 3,""
.set 3,request.servervariables("auth_user")
sdn=.get(1)
end with
set ouser=getobject("LDAP://" & sdn)
end if
if not (ouser is nothing) then
'do things with user object
else
'do things when you cannot bind to the user object
end if
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top