Hi all:
I am looking for a way to bind to a user in AD by using the User Principal
Name (Which I believe is the field on the Account tab Called User Login
Name). Now I am using the code below which correctly binds to the AD user if
the Display name is the same as the UPN but it will not bind if the Display
name is set to last name, first name. When the script runs correctly it then
updates the description field for the user, disables it and then moves it to
a deletions OU, but if I cannot bind to the user then it will not do all of
this stuff.
EX1
Display Name = aa123
UPN = aa123
works correctly binds and script continues if user enters aa123 user into
code below
EX2
Display name = Doe, John
UPN = aa123
does not find or bind to the user if you enter aa123 - script error
EX3
Display name = Doe, John
UPN-aa123
does find the user if you enter doe, john but the script will not update the
description field for the user or the rest of the .
Set objUser = GetObject _
("LDAP://cn="& getuser &",OU=users,OU=MANAGED DESKTOP
SERVICES,OU=HHH,DC=aa,DC=abc,DC=com")
where getuser is an input from a html form
Any suggestions on how to bind to the UPN as most of our users have ad id
that is not their last name, first name. Thanks