skip to Main Content

Determine if a mailbox is on-premises or in Office 365

How to determine if a mailbox is on-premises or in Office 365 located? That information is excellent if you have a migration finished, and you like to know which mailboxes are still on-premises. In this article, you will learn to check if the mailbox is on-premises or in Office 365.

How to check if a mailbox is on-premises or in Office 365?

If you have Exchange Server 2010 running, you can’t see the mailboxes located in Office 365 when looking in the Exchange Management Console (EMC). That’s because when you finish a mailbox migration to Office 365, the mailbox will be removed from EMC. Use PowerShell to get the location of the mailbox.

If you have Exchange 2013 and higher running, you can see the mailbox’s location in the Exchange Admin Center (EAC). Another way to determine the location of the mailbox is with PowerShell.

Determine if a mailbox is on-premises or in Office 365 with Exchange Admin Center

In Exchange 2013/2016/2019, you can check if the mailbox is on-premises or in Office 365. Log in to the Exchange Admin Center. Have a look at the Mailbox Type column. You can see that if the mailbox is located on-premises or in Office 365.

Determine if a mailbox is on-premises or in Office 365 Exchange Admin Center 2016

Another way to determine if a mailbox is on-premises or in Office 365 is by checking the mailbox database. Let’s have a look at that.

Click the more button in the toolbar and click Add/Remove columns.

Determine if a mailbox is on-premises or in Office 365 add column

Check the checkbox DATABASE and follow with OK.

Determine if a mailbox is on-premises or in Office 365 add column database

The DATABASE column is visible in the list view. In our example, the location of the highlighted user mailboxes is in the mailbox database DB01-2016. It means that the location of the mailboxes is on-premises.

When a mailbox location is in Office 365, the database field is empty. If the mailbox location is on-premises, the mailbox database name is showing.

Determine if a mailbox is on-premises or in Office 365 list view with column database

Export to CSV from Exchange Admin Center

Click the more button in the toolbar and select Export data to a CSV file.

Determine if a mailbox is on-premises or in Office 365 export data to a CSV file

Make sure that you check the MAILBOX TYPE and DATABASE column. Click export. Select a destination to save the CSV file.

Determine if a mailbox is on-premises or in Office 365 export data to csv select columns

Open the CSV file to verify the list with your favorite CSV viewer. You can see the location of the mailboxes in the Mailbox Type column. If the mailbox database is empty in the Database column, it means that the mailbox location is in Office 365.

Open CSV file

In the next step, we will look at how to determine if a mailbox is on-premises or in Office 365 with PowerShell.

Determine if a mailbox is on-premises or in Office 365 with PowerShell

To determine if a mailbox is on-premises or in Office 365, we will use a couple of PowerShell parameters.

  • If the mailbox location is on-premises, the RecipientType value is UserMailbox
  • If the mailbox location is in Office 365, the RecipientType is MailUser

Check one mailbox

Run Exchange Management Shell as administrator. Make use of the Get-Recipient cmdlet and the RecipientType parameter to filter the results. The mailbox location of Anna is on-premises.

Check all mailboxes and export to CSV file

List all the mailboxes. These are the user mailboxes, resource mailboxes, and shared mailboxes. After that, export the results to a CSV file. Create a temp folder if you don’t have one in the C: drive or change the path in the second cmdlet.

We have four mailboxes located on-premises and three mailboxes in Office 365.

Open the CSV file in your favorite CSV viewer. In our example, it’s the application Microsoft Excel.

Open exported CSV file

Add the -Descending switch if you want it to sort the other way around. There is no -Ascending switch for the Sort-Object cmdlet because that is the default behavior.

Only list RecipientType UserMailbox. The second cmdlet will export the results to C:\temp\Only_Usermailboxes.csv.

Let’s use a filter this time, and only list RecipientType equals to MailUser. The second cmdlet will export the results to a CSV file.

I hope that this article helped you to determine if a mailbox is on-premises or in Office 365.

Keep reading: Move mailbox to Exchange Online with PowerShell »

Conclusion

In this article, you learned how to check if a mailbox is on-premises or in Office 365. If you have Exchange 2013 or higher, you can log in to Exchange Admin Center (EAC). Check the location of the mailbox in the list view. Export the list from EAC to a CSV file. After that, open the CSV file with Microsoft Excel or another CSV viewer. The mailboxes without a database are mailboxes located in Office 365. Unfortunately, this is not possible in Exchange 2010.

Another way to find and determine if the mailboxes are on-premises or in Office 365 is with PowerShell. In the article, we showed the cmdlet to get the mailboxes and to export the results to CSV file. After exporting, open the CSV file with Microsoft Excel. The mailbox with the RecipientType MailUser value is a mailbox located in Office 365. If you do see the RecipientType UserMailbox value, that means that the mailbox location is on-premises.

Did you enjoy this article? You may also like Export a list of mailboxes to CSV in Exchange. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top