PowerShell Get-MailboxDatabase

Get-MailboxDatabase For Exchange 2010

This PowerShell cmdlet allows you to interrogate the Exchange Database(s) without having to call for the EMC.

 ♣

Getting Started with Get-MailboxDatabase

On its own the Get-MailboxDatabase cmdlet returns information about all the Exchange mailboxes in your organization.

Get-MailboxDatabase

Note 1:  You can refine the output by specifying one of your servers.

Get-MailboxDatabase -Server Mbox03

Note 2:  Another technique is to employ the -Identity parameter to display just one Exchange database.

Get-MailboxDatabase -Identity MailDb02

List the Get-MailboxDatabase Parameters

Research optional but useful parameters with Get-Help:

Get-Help Get-MailboxDatabase

Use the fruits of your research to include ‘Status’ because it forces the cmdlet to include real-time information.  For example, try this script with and without the -Status switch.

Get-MailboxDatabase -Identity MailDb02 -Status | Format-List

Status is useful for investigating backup problems on your Exchange Server 2010 with the mailbox role.

Research Properties for Get-MailboxDatabase

Get-MailboxDatabase -Identity MailDb02 | Get-Member

Interesting properties include mounted, you can incorporate the knowledge in your scripts thus:

Get-MailboxDatabase MailDb02 |  Format-Table, Name, Server, Mounted -auto

Note 3: Naturally you need to change the values to suit your server.

Free Download of Exchange Monitor from SolarWindsGuy Recommends: The SolarWinds Exchange Monitor

Here is a free tool to monitor your Exchange Server.  Download and install the utility, then inspect your mail queues, monitor the Exchange server’s memory, confirm there is enough disk space, and check the CPU utilization.

This is the real deal – there is no catch.  SolarWinds provides this fully-functioning freebie, as part of their commitment to supporting the network management community.

Free Download of SolarWinds Exchange Monitor

Exchange 2010 Permissions

If you think about it, being able to connect an Exchange Server is a responsible task.  Thus before you execute the above PowerShell scripts check that you must are a member of these exchange groups:

  • ‘Organization Management role group’
  • ‘Server Management management role group’
    Management management is not a typo!

Instead of the Exchange Management Console (EMC) try this PowerShell command:

New-ManagementRoleAssignment -Role "Organization Management role" -User YourName

Note 4: See more on PowerShell’s Get-MailboxDatabase.

Compare PowerShell with the EMC

From a learning point-of-view it it’s worth a walk-through in the Exchange Management Console (EMC), the benefit is you can compare the PowerShell script with what you see in the Exchange GUI.

  • Launch your EMC, navigate to the Server Configuration (see below.)

Get-MailboxDatabase PowerShell cmdlet

Note 5: This GUI does not display all the information about your Exchange Server 2010 that is available to PowerShell.

 

Note 6: There is also Set-ExchangeServer for times when you want to change Active Directory settings such as global catalog.

Guy Recommends:  SolarWinds’ Free Bulk Mailbox Import ToolFree Download Bulk Mailbox Import Tool

Import users from a spreadsheet, complete with their mailbox.  Just provide a list of the users with the fields in the top row, and save as .csv file.  Then launch this FREE utility, match your Exchange fields with AD’s attributes, click and import the users.  Optionally, you can provide the name of the OU where the new mailboxes will be born.

There are also two bonus tools in the free download, and all 3 have been approved by Microsoft:

  1. Bulk-import new users and mailboxes into Active Directory.
  2. Seek and zap unwanted user accounts.
  3. Find inactive computers.

Download your FREE bulk mailbox import tool.

Summary of Get-MailboxDatabase

If you want to investigate the Exchange Server then Get-MailboxDatabase will show which roles are installed, for example, ClientAccess or Edge.  If you research the properties then you can add PowerShell commands to enumerate version numbers.  Remember to append the -Status parameter to ensure that you see real-time data.

If you like this page then please share it with your friends

 


See more PowerShell Cmdlets for Exchange 2010:

Exchange 2010 Home   • Get-ExchangeServer   • Set-ExchangeServer   • New-SystemMessage   • SP1

Get-Mailbox   • Get-MailboxStatistics   • Connect-Mailbox   • Enable-Mailbox   • Disable-Mailbox

PowerShell Exchange Cmdlets   • Set-Contact    • New-Mailcontact   • Add-MailboxPermission -identity