ENTERPRISE

Exchange Server 2010 : Implementing Client Access and Hub Transport Servers - Test Cmdlets for CAS and Hub Transport Servers

4/28/2011 4:09:44 PM
Built into the Exchange Server 2010 are a number of PowerShell cmdlets to test the Client Access server and Hub Transport server roles. These enable an administrator to easily verify settings, certificates, and port access for the services. This can save an immense amount of troubleshooting time or having to set up a test infrastructure.

These cmdlets are used by the System Center Operations Manager 2007 R2 Exchange Server 2010 management pack to perform synthetic transactions. These provide the OpsMgr infrastructure with data for monitoring thresholds and producing performance reports.

There are cmdlets that specifically test the CAS functions and cmdlets that specifically test the Hub Transport functions.

The CAS test cmdlets are listed here:

  • Test-OutlookWebServices— Tests Autodiscover Settings.

  • Test-WebServicesConnectivity— Tests Exchange Web Services (EWS) functionality.

  • Test-ActiveSyncConnectivity— Tests ActiveSync functionality.

  • Test-OwaConnectivity— Tests Outlook Web App (OWA) functionality.

  • Test-ImapConnectivity— Tests the IMAP4 functionality for a user or all mailboxes.

  • Test-PopConnectivity— Tests the POP3 functionality for a user or all mailboxes.

  • Test-EcpConnectivity— Tests that the Exchange Control Panel (ECP) is accessible.

  • Test-PowerShellConnectivity— Tests PowerShell remote shell connectivity from a URI or a NetBIOS name.

The Hub Transport test cmdlets are listed here:

  • Test-Mailflow— Tests if mail can be sent from the system mailbox to another mailbox server and to external addresses.

  • Test-Message— Tests the transport rules for a test message and emails a report to the designated mailbox.

  • Test-EdgeSynchronization– Tests the Edge synchronization status for a subscription and for a specific user.

The following sections give examples of the more useful HUB/CAS test cmdlets.

The Test-OutlookWebServices Cmdlet

The Test-OutlookWebServices cmdlet verifies the Autodiscover service settings for Outlook on an Exchange server that has the Client Access server role installed. The Test-OutlookWebServices cmdlet uses a specified email address to verify that the Outlook provider is configured correctly.

An example of the Test-OutlookWebServices cmdlet is shown in Listing 1.

Listing 1. Test-OutlookWebServices Example
[PS] C:\>Test- OutlookWebServices –Identity:chrisa@companyabc.com
RunspaceId : 79f1e2b4-2db8-44c6-aa11-87464151c696
Id : 1003
Type : Information
Message : Autodiscover is about to be tested with the e-
mail address chrisa@companyabc.com.

RunspaceId :
79f1e2b4-2db8-44c6-aa11-87464151c696
Id : 1006
Type : Information
Message : Contacted the Autodiscover service at https://
EX1.companyabc.com/Autodiscover/Autodiscover.x
ml.

RunspaceId : 79f1e2b4-2db8-44c6-aa11-87464151c696
Id : 1016
Type : Success
Message : [EXCH]-Successfully contacted the AS service a
t https://ex1.companyabc.com/EWS/Exchange.asmx
. The elapsed time was 109 milliseconds.

RunspaceId :
79f1e2b4-2db8-44c6-aa11-87464151c696
Id : 1015
Type : Success
Message : [EXCH]-Successfully contacted the OAB service
at https://ex1.companyabc.com/EWS/Exchange.asm
x. The elapsed time was 0 milliseconds.

RunspaceId :
79f1e2b4-2db8-44c6-aa11-87464151c696
Id : 1014
Type : Success
Message : [EXCH]-Successfully contacted the UM service a
t https://ex1.companyabc.com/EWS/UM2007Legacy.asm
x. The elapsed time was 31 milliseconds.
RunspaceId :
79f1e2b4-2db8-44c6-aa11-87464151c696
Id : 1006
Type : Success
Message : Autodiscover was tested successfully.


As can be seen from the output, all the tests completed successfully.

The Test-OwaConnectivity Cmdlet

The Test-OwaConnectivity cmdlet can be used to test Outlook Web App connectivity for all Microsoft Exchange Server 2010 virtual directories on a specified client access server for all mailboxes on servers running Exchange Server that are in the same Active Directory site. The Test-OwaConnectivity cmdlet can also be used to test the connectivity for an individual Exchange Outlook Web App URL.

An example of the Test-OwaConnectivity cmdlet used to test access to an OWA URL (https://ex1.companyabc.com) using the user companyabc\chrisa credentials is shown in Listing 2.

Listing 2. Test-OwaConnectivity Example
[PS] C:\>Test-OwaConnectivity
–URL:https://ex1.companyabc.co
m/owa –MailboxCredential:(get-credential companyabc\chrisa)
–TrustAnySSLCertificate | fl

RunspaceId :
79f1e2b4-2db8-44c6-aa11-87464
151c696
AuthenticationMethod : FBA
MailboxServer :
LocalSite : Default-First-Site-Name
SecureAccess : True
VirtualDirectoryName :
Url : https://ex1.companyabc.com/ow
a/
UrlType : Unknown
Port : 0
ConnectionType : Plaintext
ClientAccessServerShortName :
LocalSiteShortName : Default-First-Site-Name
ClientAccessServer :
Scenario : Logon
ScenarioDescription : Log on to Live and verify the
response page.
PerformanceCounterName : Logon Latency
Result : Success
Error :
UserName : chrisa
StartTime : 7/28/2009 8:10:27 PM
Latency : 00:00:00.3750144
EventType : Success
LatencyInMillisecondsString : 375.01
Identity :
IsValid : True


The command will prompt for the password of the user chrisa during the run of the command. Note that the –TrustAnySSLCertificate parameter was used to bypass certificate checks.

The Test-ActiveSyncConnectivity Cmdlet

The Test-ActiveSyncConnectivity cmdlet performs a full synchronization between a mobile device and a specified mailbox to test the functionality of Exchange ActiveSync. If the synchronization fails, a message is displayed in the Exchange Management Shell.

The example shown in Listing 3 shows the Test-ActiveSyncConnectivity cmdlet used to test ActiveSync for the user chrisa.

Listing 3. Test-ActiveSyncConnectivity Example
[PS]    C:\>Test-ActiveSyncConnectivity -MailboxCredential (get-credential
companyabc\chrisa) -TrustAnySSLCertificate

WARNING: column "Error" does not fit into the display and w
as removed.

CasServer LocalSite Scenario Result Latency(MS)
--------- --------- -------- ------ ----------
ex1 Default-Fi... Options Success 15.63
ex1 Default-Fi... FolderSync Success 406.26
ex1 Default-Fi... First Sync Success 93.75
ex1 Default-Fi... GetItemEstimate Success 78.13
ex1 Default-Fi... Sync Data Success 156.26
ex1 Default-Fi... Ping Success 1515.75
ex1 Default-Fi... Sync Test Item Success 1375.02

During the run of the command, the get-credential cmdlet inline in the Test-ActiveSyncConnectivity command prompts for the credentials of the test user. The results of the seven tests were “success.”

The Test-Mailflow Cmdlet

The Test-Mailflow cmdlet tests mail submission, transport, and delivery for Hub Transport role servers. The cmdlet verifies that each mailbox server can successfully send itself a message. You can also use this cmdlet to verify that the system mailbox on one mailbox server can successfully send a message to the system mailbox on another mailbox server.

The Test-Mailflow cmdlet example in Listing 4 shows testing mailflow between the mailbox server EX1 to the mailbox server EX2.

Listing 4. Test-Mailflow Example
[PS] C:\>Test-Mailflow ex1 –TargetMailboxServer ex2
RunspaceId : 79f1e2b4-2db8-44c6-aa11-87464151c696
TestMailflowResult : Success
MessageLatencyTime : 00:00:02.8297541
IsRemoteTest : True
Identity :
IsValid : True

The TestMailflowResult: Success shows that the mail flow was successful.

The Test-EdgeSynchronization Cmdlet

The Test-EdgeSynchronization is a diagnostic cmdlet that provides a report of the synchronization status of subscribed Edge Transport servers. You can use the VerifyRecipient parameter with this cmdlet to verify that a single recipient has been synchronized to the Active Directory Lightweight Directory Services (AD LDS) directory service. This task provides useful information to the administrator when it is run manually.

The command must be run on a Hub Transport role server that is within the Active Directory site that the Edge Transport server is subscribed to. Listing 5 shows the results of testing the synchronization status of edge synchronization.

Listing 5. Test-EdgeSynchronization Example
[PS] C:\>Test-EdgeSynchronization -MaxReportSize 500
-MonitoringContext $true

RunspaceId : 79f1e2b4-2db8-44c6-aa11-87464
151c696
UtcNow : 7/29/2009 4:45:32 AM
Name : EX3
LeaseHolder : CN=EX1,CN=Servers,CN=Exchange
Administrative Group (FYDIBO
HF23SPDLT),CN=Administrative
Groups,CN=CompanyABC,CN=Micro
soft Exchange,CN=Services,CN=
Configuration,DC=companyabc,D
C=com
LeaseType : Option
ConnectionResult : Succeeded
FailureDetail :
LeaseExpiryUtc : 7/29/2009 5:43:49 AM
LastSynchronizedUtc : 7/29/2009 4:43:49 AM
CredentialStatus : Synchronized
TransportServerStatus : Synchronized
TransportConfigStatus : Synchronized
AcceptedDomainStatus : Synchronized
RemoteDomainStatus : Synchronized
SendConnectorStatus : Synchronized
MessageClassificationStatus : Synchronized
RecipientStatus : Synchronized
CredentialRecords : Number of credentials 3
CookieRecords : Number of cookies 2
**** TRUNCATED ****


The truncated results of the Test-EdgeSynchronization -MaxReportSize 500 -MonitoringContext $true command shows that all components are synchronized.

The cmdlet can also be used to test the synchronization status for an individual user. The Listing 6 shows the results of an example test.

Listing 6. Test-EdgeSynchronization User Example
[PS] C:\> Test-EdgeSynchronization -VerifyRecipient chrisa@companyabc.com

RunspaceId :
79f1e2b4-2db8-44c6-aa11-87464
151c696
UtcNow : 7/29/2009 4:54:50 AM
Name : EX3
LeaseHolder : CN=EX1,CN=Servers,CN=Exchange
Administrative Group (FYDIBO
HF23SPDLT),CN=Administrative
Groups,CN=CompanyABC,CN=Micro
soft Exchange,CN=Services,CN=
Configuration,DC=companyabc,D
C=com
LeaseType : Option
ConnectionResult : Succeeded
FailureDetail :
LeaseExpiryUtc : 7/29/2009 5:52:51 AM
LastSynchronizedUtc : 7/29/2009 4:52:51 AM
CredentialStatus : Skipped
TransportServerStatus : Skipped
TransportConfigStatus : Skipped
AcceptedDomainStatus : Skipped
RemoteDomainStatus : Skipped
SendConnectorStatus : Skipped
MessageClassificationStatus : Skipped
RecipientStatus : Synchronized
CredentialRecords : Number of credentials 3
CookieRecords : Number of cookies 2


The results show that the RecipientStatus is synchronized for the user chrisa@companyabc.com.

Other  
  •  Exchange Server 2010 : Implementing Client Access and Hub Transport Servers - Installing the Hub Transport Server
  •  Exchange Server 2010 : Implementing Client Access and Hub Transport Servers - Transport Pipeline
  •  Exchange Server 2010 : Implementing Client Access and Hub Transport Servers - Understanding the Hub Transport Server
  •  Implementing Client Access and Hub Transport Servers : Installing the Client Access Server
  •  Implementing Client Access and Hub Transport Servers : Understanding the Client Access Server (part 2)
  •  Implementing Client Access and Hub Transport Servers : Understanding the Client Access Server (part 1)
  •  SharePoint 2010 : Implementing and Managing In Place Records
  •  Understanding Exchange Policy Enforcement Security : Creating Messaging Records Management Policies
  •  Understanding Exchange Policy Enforcement Security : Implementing Transport Agent Policies on the Edge
  •  Safeguarding Confidential Data in SharePoint 2010 : Using Active Directory Rights Management Services (AD RMS) for SharePoint Document Libraries
  •  Safeguarding Confidential Data in SharePoint 2010 : Enabling TDE for SharePoint Content Databases
  •  Safeguarding Confidential Data in SharePoint 2010 : Using SQL Transparent Data Encryption (TDE)
  •  Safeguarding Confidential Data in SharePoint 2010 : Enabling SQL Database Mirroring
  •  Safeguarding Confidential Data in SharePoint 2010 : Outlining Database Mirroring Requirements
  •  Remote Administration of Exchange Server 2010 Servers : RDP with Exchange Server 2010 (part 2)
  •  Remote Administration of Exchange Server 2010 Servers : RDP with Exchange Server 2010 (part 1) - Planning and Using Remote Desktop for Administration
  •  Remote Administration of Exchange Server 2010 Servers : Using the ECP Remotely
  •  Safeguarding Confidential Data in SharePoint 2010 : Examining Supported Topologies
  •  SharePoint 2010 : SQL Server Database Mirroring for SharePoint Farms
  •  Remote Administration of Exchange Server 2010 Servers : Using the Remote Exchange Management Shell
  •  
    Video
    Top 10
    Nikon 1 J2 With Stylish Design And Dependable Image And Video Quality
    Canon Powershot D20 - Super-Durable Waterproof Camera
    Fujifilm Finepix F800EXR – Another Excellent EXR
    Sony NEX-6 – The Best Compact Camera
    Teufel Cubycon 2 – An Excellent All-In-One For Films
    Dell S2740L - A Beautifully Crafted 27-inch IPS Monitor
    Philips 55PFL6007T With Fantastic Picture Quality
    Philips Gioco 278G4 – An Excellent 27-inch Screen
    Sony VPL-HW50ES – Sony’s Best Home Cinema Projector
    Windows Vista : Installing and Running Applications - Launching Applications
    Most View
    Bamboo Splash - Powerful Specs And Friendly Interface
    Powered By Windows (Part 2) - Toshiba Satellite U840 Series, Philips E248C3 MODA Lightframe Monitor & HP Envy Spectre 14
    MSI X79A-GD65 8D - Power without the Cost
    Canon EOS M With Wonderful Touchscreen Interface (Part 1)
    Windows Server 2003 : Building an Active Directory Structure (part 1) - The First Domain
    Personalize Your iPhone Case
    Speed ​​up browsing with a faster DNS
    Using and Configuring Public Folder Sharing
    Extending the Real-Time Communications Functionality of Exchange Server 2007 : Installing OCS 2007 (part 1)
    Google, privacy & you (Part 1)
    iPhone Application Development : Making Multivalue Choices with Pickers - Understanding Pickers
    Microsoft Surface With Windows RT - Truly A Unique Tablet
    Network Configuration & Troubleshooting (Part 1)
    Panasonic Lumix GH3 – The Fastest Touchscreen-Camera (Part 2)
    Programming Microsoft SQL Server 2005 : FOR XML Commands (part 3) - OPENXML Enhancements in SQL Server 2005
    Exchange Server 2010 : Track Exchange Performance (part 2) - Test the Performance Limitations in a Lab
    Extra Network Hardware Round-Up (Part 2) - NAS Drives, Media Center Extenders & Games Consoles
    Windows Server 2003 : Planning a Host Name Resolution Strategy - Understanding Name Resolution Requirements
    Google’s Data Liberation Front (Part 2)
    Datacolor SpyderLensCal (Part 1)