Check Exchange 2007 with PowerShell - Part 1

Consider some of the commands that can be used to check Exchange 2007 for what they can do and how to do it.

Neil Hobson

Introduce

Network administration - After building and configuring your new Exchange 2007 server, one of the first things you need to do is test the system before allowing users to use it, even those who use your initial navigator. Any problems encountered then can be resolved before they affect the user. Microsoft has provided a set of Exchange Management Shell commands that can be used to test services and various functions of an Exchange 2007 server before you deploy into a production environment. Obviously, you can also use the same commands for the duration of using the server to retest the functionality you suspect. All of these commands start with Test-.

On a recent project we used many different Test- cmdlets to test the configuration of the established and configured Exchange 2007 server. The whole article will talk about some of the commands used. We do not introduce all the commands that can be used to test server functions because the list of these commands is quite long. In addition, each command has a number of different parameters and so it is not really feasible to introduce the whole article. What we hope is to give you some insight into the types of tests that can be done through these commands, which will make you remember to run them the next time you have configured the machine. host Exchange 2007 or while the system is running and you still like testing.

Table 1 shows a list of commands that can be used for testing purposes. The commands here are not introduced in any order. In this article, we will introduce the Test-ServiceHealth and Test-OutlookWebServices commands, while others will be introduced in Part 2.

Order name

Purpose

Test-ActiveSyncConnectivity

Check the configuration of ActiveSync for mailbox

Test-EdgeSynchronization

Check the synchronization status for registered Edge Transport servers

Test-ExchangeSearch

Check content index service

Test-ImapConnectivity

Check the function of IMAP4 service

Test-IPAllowListProvider

Check the configuration of the IP Allow List provider

Test-IPBlockListProvider

Check the configuration of the IP Block List provider

Test-Mailflow

Check sending and receiving emails

Test-MapiConnectivity

Check that the mailbox can be properly logged in

Test-OutlookWebServices

Check the Autodiscover service settings

Test-OwaConnectivity

Check Outlook Web Access

Test-PopConnectivity

Check the function of POP3 service

Test-ReplicationHealth

Check the health status of the storage group regeneration

Test-SenderId

Check the Sender ID process

Test-ServiceHealth

Check that all necessary services have been successfully launched

Test-SystemHealth

Check the entire configuration of the Exchange organization

Test-UMConnectivity

Check the operation of the unified mail server

Test-WebServicesConnectivity

Check the functionality of Outlook Anywhere

Table 1: List of Test commands

Test-ServiceHealth

Let's start with a relatively simple command, Test-ServiceHealth. With the new roles present in Exchange 2007, there is a problem with previous versions of Exchange that each Exchange server will configure different services on it, depending on the roles. will perform. For example, the Microsoft Exchange Transport service will only be found on transport servers such as Exchange 2007 servers running the Hub Transport or Edge Transport roles. A quick way to check if the required services are present and, more importantly, whether or not it has been launched is that you can use Test-ServiceHealth.

You can run the Test-ServiceHealth cmdlet on the local server to check for internal installation services, or you can use the –Server parameter to target a remote control server. In Figure 1, you can see the results when running this command on an Exchange 2007 server with the Mailbox, Hub Transport and Client Access Server roles installed. Note on how to distinguish the results given here for each role. As you can see, the main information is displayed in the RequiredServicesRunning column , which will clearly indicate whether a test is successful or not. If any requested service is not running, the RequiredServicesRunning column will display False corresponding to the service name listed in the ServicesNotRunning column .

Check Exchange 2007 with PowerShell - Part 1 Picture 1Check Exchange 2007 with PowerShell - Part 1 Picture 1
Figure 1: Default results of Test-ServiceHealth

Test-OutlookWebServices

One of the puzzling things about new Exchange 2007 components is the configuration of the Autodiscover service, especially around the issue of certificate names. If the wrong Subject Alternate Names are listed in certificates or certain configuration areas have not been completed through other Exchange Management Shell commands, the Autodiscover process will fail. For Outlook 2007 users, this means that services like Offline Address Book will not be available. However, configuring Autodiscover can be checked simply by using the Test-OutlookWebServices command . Because this service runs on the Client Access Server role, this test command must also run for the Client Access Server.

The main parameter to provide for this command is –Identity, which is the parameter used to check the Outlook provider and get the form of the email address inside the forest. The command used is:
Test-OutlookWebServices –Identity neil@neilhobson.com | fl

Check Exchange 2007 with PowerShell - Part 1 Picture 2Check Exchange 2007 with PowerShell - Part 1 Picture 2
Figure 2: Test-OutlookWebServices output

What you see from the above results are AS (Availability Service), OAB (Offline Address Book) and UM (Unified Messaging) services that have been successfully contacted by EXCH Outlook provider using the internal server's FQDN, but these services are not configured for users via EXPR Outlook provider. This is revealed by the words we show in Figure 3.

Id: 1015
Type: Information
Message: [EXPR] -The OAB is not configured for this user.Figure 3: Blending the EXPR Outlook Provider configuration

These results are a sign that some configuration components are not complete. To confirm this information, you can use the Get-WebServicesVirtualDirectory , Get-OabVirtualDirectory and Get-UMVirtualDirectory commands and check the output where the –ExternalUrl parameter appears. For example, consider Figure 4, where the Get-OabVirtualDirectory command has been run and the results show only the ExternalUrl parameter.

Check Exchange 2007 with PowerShell - Part 1 Picture 3Check Exchange 2007 with PowerShell - Part 1 Picture 3
Figure 4: Output of Get-OabVirtualDirectory

The –ExternalUrl parameter controls the URL that Outlook uses to query the OAB when running on an external network or when not in the domain. Conversely, on an internal network, Outlook will query the OAB through the –InternalUrl parameter, which will be set by default for the FQDN of the Client Access Server. However, you will need to configure the –ExternalUrl parameter. We will not talk about the length of the Autodiscover service here because that is not the focus of this article. The main thing you need here is when you see a described service 'not configured for this user' when using the Test-OutlookWebServices parameter, that means one or more –ExternalUrl parameters are missing. You must not forget that there are configurations for Availability Service, OAB and Unified Messaging. Therefore, there will be three commands to configure the external URL. For example, suppose the name of a Client Access Server is CAS1 and an external domain is neilhobson.com, then the three configuration commands will be:

Set-WebServicesVirtualDirectory -Identity 'CAS1EWS (Default Web Site)' –ExternalUrl https://autodiscover.neilhobson.com/EWS/Exchange.asmx

SetOabVirtualDirectory -Identity 'CAS1OAB (Default Web Site)' –ExternalUrl https://autodiscover.neilhobson.com/oab

Set-UMVirtualDirectory -Identity 'CAS1UnifiedMessaging (Default Web Site)' –ExternalUrl https://autodiscover.neilhobson.com/UnifiedMessaging/Service.asmx

When these commands are set up, you can rerun the Test-OutlookWebServices command where you want to see a successful check with the EXPR Outlook provider. An example of such words is shown in Figure 5.

Id: 1015
Type: Success
Message: [EXPR] -Accessfully contacted the OAB service at https: // autodiscover
.neilhobson.com / ews / exchange.asmx.The elapsed time was 0 milliseconds.Figure 5: Successful test of EXPR Outlook Provider

Conclude

So far, we have introduced two Test- cmdlet commands that you can use to check the configuration and operation of your Exchange 2007 server. Hopefully, you will see how commands such as Test-OutlookWebServices can provide values ​​within the configuration areas that have not yet been completed. We will introduce these commands in the second part of this two-part series.

3.6 ★ | 5 Vote