Discussion:
get user logon name from LDAP and ADO
(too old to reply)
Abdulfatah A. Reslan
2008-05-01 21:50:43 UTC
Permalink
Dear Sir:
Thank you for yuor help

im trying to read users from AD by LDAP and ADO i can do but i cant read
the logon name i can rerive the user object and but when type user.name it
return
full name like CN=Jone Smith how i can read logon name ??
Richard Mueller [MVP]
2008-05-02 00:06:04 UTC
Permalink
Post by Abdulfatah A. Reslan
Thank you for yuor help
im trying to read users from AD by LDAP and ADO i can do but i cant read
the logon name i can rerive the user object and but when type user.name it
return
full name like CN=Jone Smith how i can read logon name ??
The "Name" property method returns the Relative Distinguished Name (RDN),
which for user objects is the Common Name (the value of the cn attribute).
If you want the "pre-Windows 2000 logon name", this is the value of the
sAMAccountName attribute. If you are using ADO, there should be no need to
bind to the user objects. Just retrieve sAMAccountName.

For tips on using ADO with VBScript (or VB) to search AD see this link:

http://www.rlmueller.net/ADOSearchTips.htm

Using the variables names in the link, you want:

strAttributes = "sAMAccountName"
strFilter = "(&(objectCategory=person)(objectClass=user))"
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
Loading...