Generate list of default email addresses from AD

From Michael's Information Zone
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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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