Tuesday, February 14, 2012

TOP 10: Exchange Server 2010 PowerShell Commands

Here you will find a collection of the most commonly used commands I run in Exchange 2010. Enjoy!

1. Check Database Availability Group Replication Status
In some cases you may have many copies of Exchange 2010 databases and you want to view the status of them all. This command will perform that task for you but also show you a very important characteristic such as the content index state.


2. Fix a Failed Content Index
In rare cases you may notice the content index has failed. Activating a database copy with a failed content index requires additional guidance but to fix the problem beforehand, run the following.

Update-MailboxDatabaseCopy -Identity [id] -CatalogOnly

3. Move a Mailbox in a Batch
There may be cases where you need to keep track of mailbox moves both those which are in progress and to clear them afterward.

New-MoveRequest -Identity [id] -BatchName

4. Check Move Progress
The following command simply gets all the move requests and their statistics.

Get-MoveRequest | Get-MoveRequestStatistics

4. Clear a Move Request
In order to move a mailbox after a move request has completed or failed, you need to remove the request which can be done in bulk, individually, or by a batch name.

Get-MoveRequest | Remove-MoveRequest

or to remove a batch of requests already labeled...

Get-MoveRequest -BatchName [name] | Remove-MoveRequest

5. Determine Unified Messaging Enablement of a User
To check if a user is enabled for Unified Messaging, run the following.

Get-Mailbox | fl UME*

6. View Queues of all Hub Transport Servers
In some cases you may want to quickly view the queue status of all HT servers to determine if you have significant blockage along the transport pipeline.

Get-TransportServer | Get-Queue

7. Determine Active Calls on a UM Server
I find this one helpful as you can quickly see if a server is in use before performing a UM service reset or else use it for troubleshooting to see the status of a test call.

Get-UmServer | Get-UMActiveCalls

8. Determine Exchange Server 2010 Service Status
This command is helpful in quickly seeing which services are running particularly after a reboot.

Get-Service | Where {$_.DisplayName -Like "Microsoft Exchange*"}

9. Get Mailbox Sizes and Sort by Size

Get-Mailbox | Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}} -auto

10. Check Autodiscover Settings

Get-WebServicesVirtualDirectory | fl InternalUrl,ExternalUrl
Get-EcpVirtualDirectory | fl InternalUrl,ExternalUrl
Get-OwaVirtualDirectory | fl InternalUrl,ExternalUrl
Get-OabVirtualDirectory | fl InternalUrl,ExternalUrl

Get-ClientAccessServer | fl AutoDiscoverServiceInternalUri

No comments:

Post a Comment