Skip to content

Instantly share code, notes, and snippets.

@rodmhgl
Created June 28, 2013 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodmhgl/5887321 to your computer and use it in GitHub Desktop.
Save rodmhgl/5887321 to your computer and use it in GitHub Desktop.
PowerShell - Searches Active Directory for a given SAMAccountName, returns SAMAccountName, displayname, office, telephonenumber
function Get-RealName {
param ($SAMAccountName)
Get-QADUser -SamAccountName $SAMAccountName | select samaccountname, displayname, office, telephonenumber
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment