TechRid

Home » Exchange Server 2010 » High Availability » DAG » Exchange Maintenance & Monitoring with some useful commands (DC,Cluster, DAG, Databases Content Index, etc….)

Exchange Maintenance & Monitoring with some useful commands (DC,Cluster, DAG, Databases Content Index, etc….)


Exchange Management Shell (EMS) is used to get to the information based on the query we give related to exchange or cluster in Failover Manager, and below are some of the useful commands that has been performed in our Lab’s and output given accordingly.

Note : Request you to please try the below commands first in your Lab’s before performing directly in Production Servers.

These commands are used at your own risk.

Below are the List of Commands with Output

1: The below command will be give detailed information about the

product version, FileVersion & Filename for Exchange Server:

Command Input :

gcm exsetup | %{$_.fileversioninfo}

Output :

ProductVersion    FileVersion      FileName
14.03.0174.001 14.03.0174.001 C:\Program Files\Microsoft\Exchange Server\V14\bin\ExSetup.exe

2: The below command will be give detailed information about dcname, dnshostname, adsite & originatingserver

Command Input :

Get-DomainController | fl name,dnshostname,adsite,originatingserver

Output :

DC name dc1.COM
Dnshostname dc1.netsaints.com
Adsite Netsaints.com/configuration/Sties/India
Originatingserver dc1.netsaints.com

 

3: The below command will be give detailed information about name, domain, edition, fqdn, serverroles installed, site & admin displayname.

Command Input :

Get-ExchangeServer | fl name,domain,edition,fqdn,serverrole,site,admindisplayversion

Output :

Name MB1
Domain Netsaints.com
Edition Enterprise
Fqdn MB1.Netsaints.com
ServerRole Mailbox, ClientAccess, HubTransport
Site Netsaints.com/Configuration/Sites/India
AdminDisplayVersion Version 14.3 (Build 123.4)

 

Name MB2
Domain Netsaints.com
Edition Enterprise
Fqdn MB2.Netsaints.com
ServerRole Mailbox, ClientAccess, HubTransport
Site Netsaints.com/Configuration/Sites/India
AdminDisplayVersion Version 14.3 (Build 123.4)

4: The below command will be give detailed information about name, Content Index state and content Index error

Command Input :

Get-MailboxDatabaseCopyStatus –Server <servername> | FL Name,Index

Output :

Name MB1-DB001\MB1
ContentIndexState Healthy
ContentIndexErrorMessage Note: Based on the corruption depends

 

Name MB1-DB002\MB1
ContentIndexState Healthy
ContentIndexErrorMessage Note: Based on the corruption depends

 

Name MB1-DB003\MB1
ContentIndexState Healthy
ContentIndexErrorMessage Note: Based on the corruption depends

 

5: The below command will be give detailed information about Database Availability Group like DAG name, witnessserver, witnessdirectory etc…

Command Input : Get-DatabaseAvailabilityGroup -Status | fl

Output :

RunspaceId f94bf24b-e039-463e-a712-3e160d3ddd75
Name DAG1
Servers {MB2, MB1}
WitnessServer Mb3.netsaints.com
WitnessDirectory c:\DAG1-FSW
AlternateWitnessServer netsaints.com
AlternateWitnessDirectory c:\DAG-FSW
NetworkCompression Enabled
NetworkEncryption Enabled
DatacenterActivationMode DagOnly
StoppedMailboxServers {}
StartedMailboxServers {MB2.netsaints.com, MB1.netsaints.com}
DatabaseAvailabilityGroupIpv4Addresses {192.168.10.24}
DatabaseAvailabilityGroupIpAddresses {192.168.10.24}
AllowCrossSiteRpcClientAccess FALSE
OperationalServers {MB1, MB2}
PrimaryActiveManager MB1
ServersInMaintenance {}
ThirdPartyReplication Disabled
ReplicationPort 64327
NetworkNames {iSCSI-A, iSCSI-B, LAN, REPLICATION}
WitnessShareInUse Primary
AdminDisplayName
ExchangeVersion 0.10 (14.03.0174.0)
DistinguishedName                      : CN=DAG1,CN=Database Availability Groups,CN=Exchange Administrative Group (FYDIBOHF25SPDLT),CN=Administrative Groups,CN=domain Home,CN=Microsoft Exchange`,CN=Services,CN=Configuration,DC=home,DC=netsaints,DC=com
Identity DAG1
Guid fd9b8209-8edf-47e2-8798-2e56fd2a3246
ObjectCategory domain.com/Configuration/Schema/ms-Exch-MDB-Availability-Group
ObjectClass {top, msExchMDBAvailabilityGroup}
WhenChanged 1/29/2012 17:34
WhenCreated 10/19/2013 21:16
WhenChangedUTC 10/29/2014 22:24
WhenCreatedUTC 10/19/2013 22:16
OrganizationId
OriginatingServer dc1.netsaints.com
IsValid TRUE

 

6: The below command will be give detailed information about DAG but as required in short.

Command Input :

Get-DatabaseAvailabilityGroup -Identity <DAGNAME> -status |fl name, server, witnessserver,witnessdirectory,alternatewitnessserver, operationalservers, primaryactivemanager, witnessshare:

Output :

Name DAG1
WitnessServer Mb3.netsaints.com
WitnessDirectory c:\DAG1-FSW
AlternateWitnessServer netsaints.com
OperationalServers {MB1, MB2}
PrimaryActiveManager MB1

 

7: The below command will be give detailed information about Server name Databases and the size if required you can mention to export out as CSV file

Command Input :

Get-MailboxDatabase -Status | select ServerName,Name,DatabaseSize >c:\dboutput.txt

8: The below command will be give detailed information about your network with IP address and also in detailed information on ISCSI, LAN & Replication

Command Input : Get-DatabaseAvailabilityGroupNetwork | fl

 

Output :

 

RunspaceId f94bf24b-e039-463e-a712-3e160d3ddd75
Name iSCSI A
Description iSCSI A Network
Subnets {{192.168.10.0/24,Up}}
Interfaces {{MB1,Up,192.168.10.116}, {MB2AUp,192.168.10.117}}
MapiAccessEnabled FALSE
ReplicationEnabled FALSE
IgnoreNetwork FALSE
Identity DAG1\iSCSI A
IsValid TRUE

 

RunspaceId f94bf24b-e039-463e-a712-3e160d3ddd75
Name LAN
Description LAN Network
Subnets {{172.16.17.0/24,Up}}
Interfaces {{MB1,Up,172.168.12.11}, {MB2,Up,172.168.12.13}}
MapiAccessEnabled TRUE
ReplicationEnabled FALSE
IgnoreNetwork FALSE
Identity DAG1\LAN
IsValid TRUE

 

 

 9: The below command will be give detailed information about cluster node in some scenario’s this command will be veryhelpful.

 

Command Input :

 

Get-ClusterNode | ft name, Dynamicweight, nodeweight, ID, State -Autosize

 

Output : Based on your network configuration.

 

10: The below command will be give detailed information about Name, status, copy Queuelength, Replay Queue length & Content Index State.

 

Command Input : Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus

 

Output :

 

Name Status Copy Queue Length Replay Queue Length Last Inspected Log Content Index State
DB002\MB1 Mounted 0 0 Healthy
DB002\MB2 Healthy 0 2 8/13/2014 12:27 Healthy
DB001\MB2 Healthy 0 1 8/13/2014 12:28 Healthy
DB001\MB1 Mounted 0 0 Healthy
DB003\MB1 Mounted 0 0 Healthy
DB003\MB2 Healthy 0 0 Healthy
DB003\MB2 Healthy 0 1 8/13/2014 12:27 Healthy
DB004\MB1 Mounted 0 0 Healthy

 

 

11: The below command will be give detailed information about test performed on Replicaiton, :

 

Command Input :

 

a Test-ReplicationHealth This test will pass through certain test
b Test-ReplicationHealth |fl This test will pass through the tests & will explain in detail

 

12: The below command will be give detailed information about Mailbox Database with RPC ClientAccessServer

 

Command Input : Get-MailboxDatabase -Status | fl name,rpc

 

Output :

 

Name MB1-DB01
RpcClientAccessServer indiamail.netsaints.com

 

13 : Update a Database Copy (Catalog Only)

Update-MailboxDatabaseCopy -Identity <DBName>\<ServerName> -SourceServer <ServerName> -CatalogOnly

Applicable in Windows 2008 / 2008 R2

Now everything seems to be working fine and sometimes we might face core Cluster Issues then please follow the below steps :

First you need to import failover cluster

Open windows Powershell -> Run as Administrator

Run the command the below

Import-Module failoverClusters

If you want to know the Quorum type then need to run the below command

Command Input : Get-ClusterQuorum -Cluster “DAGName” | fl

Output :

Cluster DAG1
QuorumResource File Share Witness (\\ mb3.netsaints.com\DAG1.netsaints.com)
QuorumType Based on Nodes

 

If you have another Site (DR) and if you want to enable DAC mode below is the command

DAC MODE :

Set-DatabaseAvailabilityGroup -Identity DAG2 -DatacenterActivationMode DagOnly

For more information on DAC (Datacentre Activation Coordination);

http://technet.microsoft.com/en-in/library/dd979790(v=exchg.150).aspx

 

Praveen Kumar

MCTS | Exchange Server


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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: