Skip to content

Instantly share code, notes, and snippets.

@rodmhgl
Created June 28, 2013 19:15
Show Gist options
  • Save rodmhgl/5887289 to your computer and use it in GitHub Desktop.
Save rodmhgl/5887289 to your computer and use it in GitHub Desktop.
PowerShell snippet - requires Quest AD Tools - will search Active Directory for the given Display Name, and return the samaccountname, display name, office, and telephone number for matching users
function Get-SamAccountName {
param ($DisplayName)
Get-QADUser -DisplayName "*$DisplayName*" | select samaccountname, displayname, office, telephonenumber
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment