Checking if a mailbox is valid using Exchange Management Shell

Share this:

In some scenarios we need to check if a mailbox database is valid on Exchange Server, this kind of validation is useful when migrating/transitioning mailboxes.


In order to validate mailboxes we can use an if clause to validate if the mailbox exists or not in the environment, and based on that we provide a brief description. The following cmdlet can be used.

$users = Import-csv File.csv

$users| foreach { if (-not (Get-mailbox $_.Alias -ErrorAction silentlycontinue)) {write-host $_.Alias ” does not exist! Please correct it! “} else {write-host $_.Alias ” exists”} }



Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at,, and Anderson (Portuguese).

Related Post

Automating the process to join a server to a domai... In this Tutorial we are going to optimize a simple task that in larger environments may take some time from the service desk/operations team which is ...
How to generate SMTP Address reports in your Excha... In this Tutorial we are going over two simple methods to create reports to list SMTP address. The first section will cover how to list all primary SMT...
Removing Azure Active Directory users using Azure ... Cloud Shell is one of the new features in Azure Portal, and it is accessible from virtually any browser and even from Azure App. In this Tutorial, we ...
Statistics of a NIC Teaming If the UI window is sufficiently tall a statistics tile appears at the bottom of the Team tile and the Adapters and Interfaces tile. These statistics ...