Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
User PowerShell to easily obtain a user's email attribute from Active Directory.
July 28, 2014
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 -Properties mail | Select-Object -ExpandProperty mail
You could also use:
(Get-ADUser -properties mail).mail
You May Also Like