Few Poweshell commands

HUB Transport Server


Get-Queue -server ‘servername’ (Check Queue on a Hub Server)

get-messagetrackinglog -resultsize unlimited -EventID “RECEIVE” -Recipients “name@domain.com” -sender “name@mail.com” -Server “XXXYYYPP123” -Start “7/27/2010 12:00:00 AM” -End “7/29/2010 11:59:00 PM”

(To track the messages in a hub server, edit the query as needed)

Mailbox Server


Get-MailboxDatabase -server cmsname -status | select name,mounted (To check the status (Mounted) of all mailbox database in a server)

Get-MailboxDatabase -server cmsname -status | select Name,Server,*backup*,Mounted (To check the last Backup of all mailbox database in a server)

Dismount-Database CMSNAME\CMSNAME-SG01 (Dismount a single database)

Get-MailboxDatabase -server cmsname | Dismount-Database (Dismount all the mailbox database in a server)



Get-StorageGroupCopyStatus -server cmsname (To check the replication status of all storage group in a server)

Test-ReplicationHealth (To check the replication health of a cluster)

Suspend-MailboxDatabaseCopy -Identity CMSname\CMSname-SG01 -SuspendComment “Maintenance on 001” (Pause the replication of a storage group)

Resume-MailboxDatabaseCopy -Identity cmsname\CMSname-SG01 (Resume the replication of a storage group, which was paused)

Restore-StorageGroupCopy CMSNAME\CMSNAME-SG01 (Ignore the consistency state and make database mountable, possible of data loss)

Update-StorageGroupCopy CMSNAME\CMSNAME-SG01 -DeleteExistingFiles (Reseed the replication which was failed)

Move-ClusteredMailboxServer -Identity ‘CMSNAME’ -MoveComment ‘Install Forefront on A node’ -TargetMachine ‘nodeb’

Troubleshooting Cluster Servers


1. Always use “Move-ClusteredMailboxServer” command to failover the server

2. Before failover the server, it is better to check whether the passive node is up to date.

Run “Get-StorageGroupCopyStatus” to see the target database is updated. The copy status should be Healthy and CopyQueueLength & ReplayQueueLength should be 0.

Do not failover the cluster if there is some value in CopyQueueLength or ReplayQueueLength unless it is really required. (Less value in CopyQueueLength & ReplayQueueLength is less data loss)

3. If the copy status failed first try “Resume-MailboxDatabaseCopy” then “Update-StorageGroupCopy” (Do not go for “Update-StorageGroupCopy” without seniours advise)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s