How can you test your Exchange Server databases to see whether they are online and responding to client requests? You could use Outlook to connect to a mailbox on the database, but if you have a lot of databases to test that is not going to be very efficient.

Exchange Server 2013 (as well as 2007 and 2010) have the Test-MAPIConnectivity cmdlet available in the Exchange Management Shell. As the name suggests, this cmdlet allows you to test the MAPI connectivity to the database.

To test all the databases in the organization you can pipe the output from Get-MailboxDatabase into Test-MAPIConnectivity.

[PS] C:\>Get-MailboxDatabase | Test-MAPIConnectivity

MailboxServer      Database           Result    Error
-------------      --------           ------    -----
E15MB1             Mailbox Database 1 Success
E15MB1             Mailbox Database 2 Success
E15MB2             Mailbox Database 3 Success
E15MB3             Archive Database   Success

To test the databases on a single Mailbox server use the -Server parameter. In a database availability group this will test all of the active mailbox database copies for that Mailbox server.

[PS] C:\>Test-MAPIConnectivity -Server E15MB1

MailboxServer      Database           Result    Error
-------------      --------           ------    -----
E15MB1             Mailbox Database 1 Success
E15MB1             Mailbox Database 2 Success

To test one specific database use the -Database parameter.

[PS] C:\>Test-MAPIConnectivity -Database "Mailbox Database 1"

MailboxServer      Database           Result    Error
-------------      --------           ------    -----
E15MB1             Mailbox Database 1 Success

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Dhin

    Will you be able to give me a script for availability report which has only Test-Mapiconnectivity.

    1. Matt

      We had the same issue – one of my guys fixed it with this.
      Make the modifications to the script:
      current MAPI test:
      $mapistatus = Test-MapiConnectivity -Database $db.Identity -PerConnectionTimeout $mapitimeout

      New MAPI test:
      $dbIdentity = ($db.Identity).toString()
      $mapistatus = Test-MapiConnectivity -Database $dbIdentity -PerConnectionTimeout $mapitimeout

  2. Aiva

    Hi, needed something like that.
    My problem is that i added 2 aditional servers. 1 with all roles and 1 with CAS/HUB. to the farm which already had 2 multirole servers which worked well and 1 servers with mailbox role only.. (now we have 5 servers: 3 multirole, 1 CAS/HUB and 1 mailbox roles installed)…So then the problem started, because we used ms load balancer to multirole servers and he failed.. But outlook still been able to connect when i used only 1 new CAS/HUB server. But our Blackberry enterprice server didnt liked what and started to generate Error logs 10k/hours and more.
    maybe i already know the answer but.

    do i need allways use command set-rpcclientaccessserver to add new server, to existing CAS servers farm ? poweshell where showing me that he knows about new CAS/HUB server.. but maybe it cant reach the mailboxes.

    our organisation have 1k+ users, i dont think that we need expensive hw load balancer, maybe its possible to make something like 2 CAS/HUB servers with ms load balancer for outlook in the default-site and 1 additional CAS/HUB without adding to the load balancer… because BB mapi dont like a lot than problems with CAS starting.

    Maybe question is silly, i only guessing how to make it better 🙂

  3. Rusty Shackleford

    I have 21 databases so I use the following which is more about the status of the database versus each individual mailbox:
    Get-MailboxDatabase | get-mailbox -ResultSize 1 | Test-MAPIConnectivity | ft

    I follow a similar format when testing searches…….
    Get-MailboxDatabase | get-mailbox -ResultSize 1 | Test-ExchangeSearch | ft

    Peace.

      1. Rusty Shackleford

        Hmmm?!?!?!? It appears that I took the long way to get the results. Defaulting to the system mailbox gets the results considerably faster. Thanks for the reminder why I subscribe to your RSS feeds 🙂

        Peace.

  4. Arras

    I was looking for something like this.

    I have a DB that I moved all the mailboxes to another one. It had a white space of 100GB, so I dismounted ran defrag and went I try to mounted again it wouldn’t mount. I ran a repair and still nothing. I then moved the Translogs to a temp location and was able to mount it.
    Then later someone added a new user and placed it on the questionable DB. Well the mailbox was not accessible. I deleted the mailbox and created a new one in a different DB. So I been trying to find out what’s wrong with this DB. Also I cannot delete it because it has arbitration mailboxes, different story.
    I ran the command and I get this:
    MailboxServer Database Result Error
    ————- ——– —— —–
    Server DB01 *FAILURE* [Microsoft.Exchange.Data.Storage.ObjectNotFoundException]: The process failed to get the correct properties. Inner error [M…

      1. Arras

        I finally was able to delete the DB. The problem was it had all the arbitration mailboxes and 1 system mailbox. The problem was that all these mailboxes were on the parent domain, but I found the solution by using
        Get-Mailbox -Arbitration -DomainController “ServerName” | New-MoveRequest -TargetDatabase “db” -DomainController “ServerName”.

        The key was -DomainController at the beginning and at the end switch.

Leave a Reply