PowerShell Get-ExchangeServer

Get-ExchangeServer For Exchange 2010

If you want to know which servers have which roles, then Get-ExchangeServer will reveal MailboxServer, ClientAccess or other role for your Exchange servers.

This PowerShell cmdlet will also return more information about your Exchange Server, for example, version and domain values.


Getting Started with Get-ExchangeServer

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


Note 1:  As with most PowerShell cmdlets you can control the output display by piping the output into Format-List (or Format-Table).

Get-ExchangeServer -Identity ExSv1 | Format-List

Note 2:  If you want to focus on just one server append the -Identity parameter.

List the Get-ExchangeServer Parameters

Extend your scripting capabilities by getting to know more parameters:

Get-Help Get-ExchangeServer

Use the information to specify the status because it forces the cmdlet to include real-time information.  For example, try this script with and without the -Status switch.

Get-ExchangeServer -Identity ExSv1 -Status | Format-List

Research Properties for Get-ExchangeServer

Get-ExchangeServer -Identity BigServ | Get-Member

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

Get-ExchangeServer | where {$_.ServerRole -match "Mailbox"}

Note 3: You could also use the property information to filter the server’s version number, then instead of ServerRole you could use AdminDisplayVersion.Major.

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 Permissions

If you think about it, being able to connect an Exchange Server is a responsible task.  Thus before you execute the appropriate PowerShell script you must be 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-ExchangeServer.

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-ExchangeServer 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-ExchangeServer

If you want to investigate the Exchange Server then Get-ExchangeServer 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.