This should work:
strUserName = *INSERT NAME HERE*
Set objConnection = CreateObject(ADODB.Connection)
objConnection.Open Provider=ADsDSOObject;
Set objCommand = CreateObject(ADODB.Command)
objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
Marie-Therese Fahmy wrote:
I need a script to search for userID for users and give me their full
name. We have Active Directory 2003.
What You mean as userID?
Take a look at this examples:
http://www.rallenhome.com/books/adcookbook/code.html
and scriptomatic tool:
I'm curious though. You want to convert their userid from what it is now
and change it to first name last name ??
Is this just to make the MMC tools look better or is there some other
reason?
Al
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
I'm assuming by convert you mean associate? (i.e. given a user ID, show me
the Full Name?
You could use adfind (www.joeware.net)
adfind -b dc=mydomain,dc=com -gc -f objectCategory=person sAMAccountName Name
That returns something like:
dn:CN=Robert Smith,CN=Users,DC=mydomain,DC=
name:
dsquery can also find the information also. The syntax is:
dsquery * -filter (samAccountName=name) -attr displayName
I would use the Joeware tool, because I'm frustrated with some of the
limitations of dsquery. I just haven't had the need yet to learn to use
the Joeware tool.
-Andrew