Exchange Server has many power shell commands that can be used for troubleshooting.
We can manage and troubleshoot Exchange Server 2013 using power shell from a remote Windows 7 Computer.
To do this we need to follow these steps.
First we need to run this command to supply Admin Credentials
$UserCredential = Get-Credential
Then run this command to enable remote command execution as we would be managing exchange Server remotely
Finally run these command to import the exchange cmdlet modules to windows 7 machine
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange 2013 Client Access server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Now we will discuss some of the important commands to troubleshoot exchange Server 2013 issues.
Test-MapiConnectivity – This command verifies server functionality. This command logs on to the mailbox that you specify (or to the SystemMailbox if you don’t specify the mailbox name.It checks 2 main connections i.e LDAP and MAPI.
Here is an example for checking connectivity of a server.
Test-MapiConnectivity -Server “Server01”
We can use this command to check the connectivity of a mailbox as well using identity parameter.
Test-MapiConnectivity -Identity “rimtech\manu”
Test-ServiceHealth – This command is to test whether all the Microsoft Windows services that Exchange requires on a server have started. Here is an example for this command
[PS] C:\>Test-ServiceHealth -Server E15MB3
This command will give you an error if any service that is automatic is not started.
Test-MRSHealth – This command checks the health of Mailbox replication Service. The Microsoft Exchange Mailbox Replication service runs on Mailbox servers. This command ensures that the Mailbox Replication service is running and that it responds to a remote procedure call (RPC) ping check.
Run this command to check the replication service on all mailbox servers.
Get-MailboxServer | Test-MRSHealth
It gives you output like this.
[PS] C:\>Test-MRSHealthRunspaceId : e9dc1305-6b80-4e92-a8b7-9efb06e0894fCheck : ServiceCheckPassed : TrueMessage : The Mailbox Replication Service is running.Identity : E15MB1IsValid : TrueObjectState : New
If you want to run this test on one server, run this command
Test-OutlookWebServices – This command allows you to test the functionality of the following services:·
- Auto discover·
- Exchange Web Services·
- Availability Service·
- Offline Address Book
This command should be run on a client access server since all these services run on a client access server. This command can also be run against a mailbox to check if free/busy information is getting synced from a client access server for that particular mailbox.
Here is an example
Test-OutlookWebServices -Identity:firstname.lastname@example.org –mailboxcredential (Get-credential)
The command will ask you for administrator user name and password
Test-Mailflow – This command checks the end to end mail flow between two mailbox servers.It also diagnoses whether mail can be successfully sent from and delivered to the system mailbox on a Mailbox server
Below command tests the mail flow between two servers.
Test-Mailflow Mailbox1 -TargetMailboxServer Mailbox2
These were few common troubleshooting cmdlets for exchange Server 2013.