Quick tip – Find users with specific email domain using PowerShell

Do you ever find yourself needing to find users with a specific email domain in Exchange but find yourself battling the correct syntax with the filter command, or waiting ages for it to get through all your objects using the Where-Object command? The following one-liner quickly produces a list of users who’s primary email address is a specific domain.

In order for you to find users using PowerShell, all you need to do is enter this command;

Find a Mail User

Get-MailUser -Filter { WindowsEmailAddress -like “*@example.com” }

Find a Mailbox

Get-Mailbox -Filter { WindowsEmailAddress -like “*@example.com” }


CONCLUSION:

Using the above command you can quickly collect a list of users, export them to CSV using | Export-CSV or copy your data straight to the clipboard using | clip and post it into your documents/files.

Get in touch if you need any further support.

Book a discovery call advert

IT assessments and workshops

In this blog post our Strategic Partner Manager, Gemma Horsell, highlights how we help our partners generate sales opportunities through IT assessments and workshops.

The benefits of the cloud

Video. Covid 19 has been a real-life use case for cloud migration, but what are the key benefits of the cloud? In this video Matt Garrett, discusses key drivers for cloud migration.

Cloud Business logo white
Microsoft Gold Partner Logo - Cloud Business

Cloud Business Limited
8 North Street
Guildford
GU1 4AF

2021 © Cloud Business Limited
Registered Company in England and Wales 06798438