Generate list of default email addresses from AD
Revision as of 09:06, 8 November 2017 by Michael.mast (talk | contribs) (Created page with "<pre> Get-ADUser -filter {enabled -eq "True"} -Properties * | where {$_.office -match "[a-z]"} | select name,@{Name="Address";Expression={$_ | select -ExpandProperty proxyaddr...")
Get-ADUser -filter {enabled -eq "True"} -Properties * | where {$_.office -match "[a-z]"} | select name,@{Name="Address";Expression={$_ | select -ExpandProperty proxyaddresses | foreach {if ($_ -cmatch "SMTP:"){$_ -replace 'SMTP:',""}}}} | sort name name Address ---- ------- John Doe johndoe@johndoe.com