Using PowerShell to obtain a list of email accounts for a specific domain

Fairly simply command worked for me: -
Get-Mailbox -resultsize unlimited | Select-Object -expandproperty emailaddresses | Where-Object {
$_.smtpaddress -ilike "*domain*"} | Select-Object SmtpAddress | Export-CSV "c:emaisl.csv"

Smile

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.