PowerShell command prompt

Use PowerShell to Obtain User's Email Attribute

Q: How can I use PowerShell to obtain a user's email attribute?

A: The best PowerShell code for obtaining a user's email attribute is:

Get-ADUser <user> -Properties mail | Select-Object -ExpandProperty mail

You could also use:

(Get-ADUser <user> -properties mail).mail

 

TAGS: Windows 8
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish