Tuesday, 22 April 2014

10 PowerShell cmdlets That Make Exchange 2013 More Robust

PowerShell cmdlets, the task automation and configuration management framework from Microsoft has become important throughput its product release cycle in the recent years. This is shaping all the tools and technologies that are coming out of their stable. A whopping 187 new PowerShell cmdlets have been introduced in Exchange 2013. In this article, we will discuss ten popular PowerShell cmdlets that you need to keep in mind if you are planning to deploy Exchange 2013 in the near future.

Mobile devices have become increasingly popular. With the help of Get-MobileDevice cmdlet admins can view the list of all of the mobile devices that are associated with a certain mailbox. For instance to view the list of all devices that are linked to a mailbox named Calra you need to make use of the following command
Get-MobileDevice –Mailbox "Calra"

When message queue is drained all active messages in the queues on the source Mailbox server can be routed to the target Mailbox server using the Redirect-Message cmdlet.  Once all the messages are received and queued by the target Mailbox server, the messages are made redundant.
The source server doesn’t accept new messages while the queues are drained. You will need to specify the source and the destination server names using the follow syntax.            
Redirect-Message –Server –Target

This cmdlet returns complete list of licenses that are in use in your Exchange 2013 Preview organization. It will return you a list of Standard and Enterprise edition server and CAL licenses for Exchange 2013.

With the help of this cmdlet Get-HealthReport admins can easily get updates on the health of various Exchange Server 2013 components. In the following example we will retrieve health information Outlook Web App's using the following command.       
Get-HealthReport –InputEntries OWA –InputObject Maintenance

This is quite similar to the Get-HealthReport with the only difference being that it allows you to check the overall health of an Exchange 2013 server instead of individual components. Here you would need to provide the identity of the Exchange server that you want to retrieve information about along with the name of a domain controller. The syntax for this would be            
Get-ServerHealth –Identity –DomainController

It works as an authorization server that issues tokens trusted by Microsoft Exchange Server 2013 for access by partner applications. However you will need to be assigned permissions before you can run this cmdlet. Let us take a look at the syntax for this      
Get-AuthServer |Format-List

This cmdlet is used for diagnosing problems with Exchange ActiveSync. Here admins can use it to retrieve all the list of ActiveSync-related statistics on a per-mailbox basis. This is extremely useful when there are a large number of accounts involved. This is also used to retrieve log files related to a mobile device and send this for analysis.   
Get-HealthReport –InputEntries OWA –InputObject Maintenance

In Exchange 2013 Microsoft has gone back to public folders which can now easily be protected by a database availability group (DAG much similar to the mailboxes. This is a multistep process where the cmdlet allows you to specify the source database and a .csv file containing exported public folder statistics. Let’s take a look at one of the examples               `
New-PublicFolderMigrationRequest –SourceDatabase A1 –CSVData (Get-Content C:\Data\Example.csv –Encoding Byte)

Test MigrationServerAvailability     
This cmdlet verifies that you can communicate with the on-premises mail server which house the mailbox data that you want to migrate to cloud-based mailboxes. It is important to specify the migration type when you are making use of it. You can specify whether to communicate with an IMAP server or an Exchange server. We will see the migration using IMAP in the following example
Test-MigrationServerAvailability -Imap -RemoteServer -Port 123

There are a number of components that are used to monitor Exchange of which Set-ServerMonitor cmdlet is one of the most popular. Using this you will be able to enable individual server monitors by specifying the name of the monitor and the name of the server. Here we will take a look at an example for a server named Sydney where we will use the following command.        
Set-ServerMonitor –Name Maintenance –Server Sydney

We have covered these ten cmdlets as they are most likely to be used. If you want to gain maximum out of Exchange you would need to familiarize yourself with all the new PowerShell cmdlets. There are a number of legacy cmdlets that have been retired with the recent update.


Post a Comment