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

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Creamer, Mark
Sent: Thursday, February 17, 2005 8:22 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] script to convert userID to first and lastname
of users

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: Robert Smith
>sAMAccountName: SmithR


<mc>

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marie-Therese
Fahmy
Sent: Thursday, February 17, 2005 8:38 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] script to convert userID to first and lastname of
users

I need a script to search for userID for users and give me their full
name. 
We have Active Directory 2003.

Thanks,
Marie 

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/


This e-mail transmission contains information that is intended to be
confidential and privileged.  If you receive this e-mail and you are not
a named addressee you are hereby notified that you are not authorized to
read, print, retain, copy or disseminate this communication without the
consent of the sender and that doing so is prohibited and may be
unlawful.  Please reply to the message immediately by informing the
sender that the message was misdirected.  After replying, please delete
and otherwise erase it and any attachments from your computer system.
Your assistance in correcting this error is appreciated.  Thank you.
Cintas Corporation.

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to