DSCommands

I will like to use dsquery or dsget command to find a DN for user.  I know I find this information from a machine using the current logon  %username% command.  But I like to use this command for a user who machine I am not login into.

This is command I know about  

dsquery * domainroot -filter "(samaccountname%username%)"


This command only works with the current logon users.    I will like to specify a different user and receive his DN.
JCJohnson76Asked:
Who is Participating?
 
footechConnect With a Mentor Commented:
It works even without piping to dsget.
dsquery user -samid someusername
0
 
alicainConnect With a Mentor Commented:
Hi,

We need to first find the user with a dsquery, then pipe that into a dsget command :
   dsquery user -name the_users_account_name_here | dsget user -dn

Regards,
Alastair
0
All Courses

From novice to tech pro — start learning today.