dsget search by samid

Posted on 2009-04-15
Last Modified: 2012-05-06
I have a username/samid and need to find the email address of this user.

I know only the account name/samid of the user and want to find the email of this user.
Can I do that with dsget or dsquery? I know how to search for a full name of a person but I cant seem to find any info on how to search by samid, is it possible?

I tried "dsget user -samid username", but that didnt work..
Question by:bergsprekken
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

rmcgregor earned 400 total points
ID: 24146888
Not exactly.

You should use dsquery to search this user and dsget - to get details.

dsquery user -samid username* | dsget user -email

Assisted Solution

anuroopkoka2005 earned 100 total points
ID: 24146909
Try to download the free script from the below link which will display the user details:

Expert Comment

ID: 24146916
this simple script will give u all the details about the user account...

Author Closing Comment

ID: 31570362
Thanks for the command description and exmple rmcgregor it was exactly what i needed. And thanks for posting the script anuroopkoka2005.

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question