PowerAddict.net

powerAddict.NET

by Lou Goban
IT Application Professional at Syntax

Find users by specific email domain with PowerShell

Sometimes you will need to find users by specific domain. Here is short PowerShell cmdlet which you can use:

Note:
I will use new Get-EXOMailbox cmdlet, and Exchange Management Module V2 is mandatory for that.

Get-EXOMailbox -ResultSize Unlimited -Filter {EmailAddresses -like "*@domain.com"} | Select DisplayName

Replace @domain.com with your desired domain.

Additionally you can export the result with Export-CSV cmdlet.
Example:

Export-CSV -path $env:USERPROFILE\Desktop\output.csv

Leave the first comment

Related posts