Gathering Exchange 2010 Client Access Server Configuration data to a Microsoft InfoPath form…
I have been planning an upgrade within an DAG based Exchange 2010 Service Pack 1 environment to Exchange Service Pack 2 with Roll up 2. When planning such upgrades I always like to gather as much configuration data as possible – mainly focussing on areas such as Client Access Server settings.
However – there are a couple of things that I have always personally found a little bit painful about the information gathering process:
- Getting detailed enough information in relation to Client Access Servers can be laborious
- When you have the information out of the system, it is usually in XML format (or something similar) – this is not always easy on the eye
Now the first issue is fairly easy to address – there are a number of scripts on the Internet which are designed to get information about a whole range of facets within your Exchange infrastructure. Given that this post is based predominantly on Client Access Servers – Microsoft has a script available that can pull pretty much all of the configuration data for your CAS to a XML File.
Microsoft’s ExportCASConfig.ps1 Script
You can download Microsoft’s script that exports all of your Client Access Server data to an XML file from the following location: http://gallery.technet.microsoft.com/scriptcenter/f239a99c-20bf-4b03-9a22-361a5ec9bb2c
This should be executed on each of your Client Access Servers (that you wish to maintain a record of) according to the instructions below.
Before using the script I recommend that you make the following modifications within the script as I found that it threw a couple of errors when I first used it:
You should change the $setupRegistryPath key variable within the script from:
$setupRegistryPath = "HKLM:\SOFTWARE\Microsoft\Exchange\Setup"
To the following value:
$setupRegistryPath = "HKLM:\SOFTWARE\Microsoft\ExchangeServer\Setup"
I think that the script was originally written for the RTM of Exchange 2010 (or perhaps 2007) – anyhow within my environment the REG path was different so I changed it to the above.
I also recommend that you change the $script:logfilepath to a location on your server which is not the C:\ drive, this is configured on the following line within the script:
$script:logfilePath = $installPath + "Logging\SetupLogs\cloneLogFile.log"
To something like this:
$script:logfilePath = "X:\Scripts\cloneLogFile.log"
I also recommend that if you are not using the Unified Messaging role within your environment that you comment out the
"Get-UMVirtualDirectory -server $Machinename",
Line which is located in the “ReadCloneItems” function – otherwise the script will throw an error.
Running the script
Ensure that your Client Access Servers are configured to allow the execution of downloaded scripts from the Internet – as per the following article: Running Exchange Based PowerShell script files from the command line or a batch file
Ensure that you have made the above modifications to the script and you will be ready for execution. The syntax is as follows:
.\CloneCASSettings.ps1 –cloneConfigData <Path>\<xml filename>
For the purposes of this article, I recommend that the –cloneConfigData path is the root of you IIS directory on the Client Access Server (this is because the InfoPath form that I have developed needs to be configured to poll its data from that location).
Info Path Form Download
You can download my Info Path form from the following location
You will need a copy of the Microsoft InfoPath Designer tool to modify the Data Source (the form supplied is configured to poll the XML file that you have generated in the IIS root on your Client Access Server).
Configuring the Form
Open the “ClientAccessServerConfiguration.xsn” from in InfoPath Designer and click on the “Data” tab on the Ribbon – ensure that the “Show Fields” option is selected:
From the fields option box (that should be on the Right hand side of the screen) – click on the “Manage Data Connections” option – see below
From the “Data Connections” dialog box select the “casData” option and then click on the “Modify” button – see below
On the first page of the “Data Connection Wizard” provide the URL path for the XML file that was created when you executed the Powershell script, when done click “Next” – see below
InfoPath Designer will then attempt to connect to the XML file on your Client Access Server, once a successful connection has been made you will be asked if you would like to access the data from the URL that you have provided – select the “Access the data from the specified location” radio button and then click “Next” – see below
Ensure that the Data Connection is called “casdata” and the “Automatically retrieve data when the form is opened” tick box is checked – when done click on the “Next” button – see below:
Sample Form Report
The following is a sample report which was generated from within my environment to give you an idea of the format that you can expect to see should you make use of both the script and InfoPath form.
You can customise the InfoPath form to encompass more information that is generated by the script by adding more fields from the XML file should you need to.