Building a Lab with Exchange 2007 on Windows 2008 Using PowerShell
Published Sep 03 2008 02:53 PM 3,975 Views

Hi from Alabama. This is a follow-up to my last post, which was about building a lab with Exchange 2007 on Windows Server 2003 using a PowerShell script. This post is about building the same lab using Exchange Server 2007 SP1 on Windows Server 2008. I just got a new server and started playing with 64-bit Windows Server 2008 guests in Hyper-V, and that gave me the tools I needed to build the new lab.

This lab is exactly the same lab (from the Exchange viewpoint) as the one referenced in my earlier post. Same servers, same IP addresses, same naming convention, etc. For a refresher on those, please see my previous post. I did change the lab domain name to Not that it affects anything in the lab - make your domain anything you want it to be.

On Windows Server 2008, I found that the pre-Exchange setup steps were much simpler than on Windows Server 2003. Of course, there are some steps that are exactly the same, but much of the installation of pre-requisites (IIS, ADAM, failover clustering, etc.) is handled by the script.

Also, there are some significant differences in the scripts and some slight changes in the CSV files, so a careful comparison of the Windows Server 2003-based script and CSV files could be helpful.

Lab Diagram

Here's a diagram of the lab that we will be using (same lab diagram as Exchange 2007 on Windows 2003, I just added it here for your convenience):

Lab Configuration

I found that the lab build-out was much easier on Windows Server 2008. There was very little I had to do to prepare the base operating system install for my script.

Here are the steps you need to take to prepare your lab:

  • Ensure that all machines in the lab are connected to the same network. If you want to update these machines to the latest patch levels, this network should connect to the Internet.
  • Put a base operating system using Windows Server 2008 Enterprise Edition on each server. 64-bit or 32-bit both work (with the understanding that 32-bit Exchange 2007 is just for labs and demos, of course).
  • In my labs, I disable User Account Control (UAC). Whether you want this in your environment or not is up to you. See this TechNet article for details on how to disable UAC.
  • Make sure that Powershell is loaded on all servers. You could do this in your base operating system build, or you can add it after Windows 2008 is installed. Use the following command (at the command prompt) to install PowerShell.
    • ServerManagerCmd -i PowerShell
  • Run DCPromo - I typically allow DNS to be installed by DCPromo process in labs where I'm only going to have a single DC.
    • On the DC, add Active Directory Domain Services (ADDS) remote management tools by running the following command:
      • ServerManagerCmd -i RSAT-ADDS
  • Reboot the DC after installing the ADDS remote management tools.
  • Add a reverse lookup zone to your DNS server. This is not strictly required, but I just like to have it.
  • Join all machines to the domain except for the Edge Transport server.
  • Make sure that the Site configuration is set such that the local subnet defines the Site. This is critical if you are going to have an expanded lab with multiple Sites and subnets. For our simple one-Site, one-subnet lab, it isn't as important.
  • Pre-create the machine account for your cluster using the name labhsv-xcl001. For the File Share Witness (FSW), we need to add some rights so that the cluster machine account can access the share used for the FSW. Make sure you also disable the cluster machine account. Note - I should really do this in my script. If you happen to have the code to do this, send it on!
  • Log in as the Enterprise Administrator on the DC (to ensure Schema Admins permissions).
  • Insert the Exchange 2007 SP1 DVD in the DC, and execute this command from the DVD:
    • /PrepareAD /OrganizationName:Contoso
  • While still logged in as the Enterprise Administrator on the DC, execute this command from the DVD:
    • /PrepareDomain
  • Create an Exchange Administrator user account (ExchAdmin) and configure it to be a domain administrator. This allows the account to be a local administrator on all domain machines so that installing Exchange is easier.
  • Remove this account from the Domain Users group, and then add the account to the Exchange Organization Administrators group.
  • Set the domain suffix on the Edge Transport server to "" to match the internal domain name for the lab.
  • Add the IP address of the Edge Transport server as a host record on the internal DNS server.
  • Configure the network on both CCR nodes:
    • Add a second network to both CCR nodes.
      • Second network adapter should be a cluster-use only network that does not connect to the Internet.
      • This network should not have DNS servers or default gateway configured.
      • This network should not register itself with DNS.
      • Manually configure the network on the second NIC as follows:
Node Name IP Address Subnet Mask
    • On each cluster node, add the entry for the other system to each Hosts file (C:\windows\system32\drivers\etc\hosts):
      • labhsv-xcl001r1 (added to Node2's Hosts file)
      • labhsv-xcl001r2 (added to Node1's Hosts file)

NOTE: That says "R1" and "R2" on the end, not "N1" and "N2". This is for the "Enable-ContinuousReplicationHostName" cmdlet where we need unique names for cluster resources to configure continuous replication across a redundant network.

  • Ensure that the network connection order is correct. In Network Connections, choose Advanced and then Advanced Settings. Move the public network to the top and the private network below the public network.

Definition of the CSV Files

The CSV files for this lab are very similar to the Windows 2003-based lab, but there are some differences. Be careful to use the right set of CSV files with the right operating system. Each of these files is detailed below by describing what each element is. The actual format, as CSV files, is that the descriptive name of each element is in the first line of the file, with the various attributes to be given to the install script on each line below. Take care to ensure that the right attributes line up in the same order as the "header line" in the first line of the file.

Descriptive Name (from file) Description Example
ProductKey This is a product key for Exchange Server 2007 that will be applied to each and every server in the environment. 12345-12345-12345-12345-12345

This is the short name of a single global catalog server that will be used on all of the commands in the script that write to the Active Directory. This will ensure that when we have writes to Active Directory followed quickly by a read that Active Directory replication delays will not affect execution of our script.

FirstPFServer This is the short name of the first Hub Transport server installed in the organization. Could be used in the future to facilitate replication of public folders. labhsv-xhb001
Descriptive Name (from file) Description Example

This is the name of the Hub Transport server where the file share witness (FSW) share will be hosted. This was added to allow for FSW creation on two different Hub Transport servers in two different data centers with the same data file.



This is the name (not necessarily the FQDN) of the clustered mailbox server (CMS) for which given FSW is being created.



This is the share name that will be created on the Hub Transport server and later utilized by the CMS (the specific CMS in this row) as the FSW share.



This is the account (in domain\account format) that represents the cluster machine account.



Descriptive Name (from file) Description Example

This is the name (not necessarily the FQDN) of the CMS for which given FSW is being created.



This is the TCP/IP address of the cluster represented by the CMSName that defines this row.


This is the TCP/IP address of the CMS that defines this row.


This is a host name used by the Exchange cluster to define replication on a redundant network. This name is specific to the first cluster node, and should be the same as the cluster node with the "n" node designator replaced with "r". For the example here, the cluster node would be labhsv-xcl001n1.



This is the TCP/IP address of the Node1ReplName on this row.


This is a host name used by the Exchange cluster to define replication on a redundant network. This name is specific to the second cluster node, and should be the same as the cluster node with the "n" node designator replaced with "r". For the example here, the cluster node would be labhsv-xcl001n2.



This is the TCP/IP address of the Node2ReplName on this row.


Descriptive Name (from file)

Description Example

This is the name (not necessarily the FQDN) of the SCR target server.



This is the name (not necessarily the FQDN) of the CMS that will act as an SCR source.


If the lab is built with the machine names and IP addresses listed above, the included CSV files will work without modification.

Execution of the Script

During execution of the script, it is assumed that the CSV files are located in the same directory as the script itself.

You should deploy this lab in the following order:

  • labhsv-xet001
  • labhsv-xhb001 (required before the cluster nodes)
  • labhsv-xcs001 (in production you need CAS before Mailbox roles)
  • labhsv-xcl001n1 (required before node 2 and SCR)
  • labhsv-xcl001n2
  • labhsv-xsc001

On each server where Exchange will be deployed, follow these steps:

  • Mount your Exchange 2007 SP1 CD
    • SP1 is required for the Enable-ContinuousReplicationHostName cmdlet.
  • Open Windows PowerShell, change to the directory where you stored the script and CSV files, and then execute the following command to allow scripts to run:
    • Set-ExecutionPolicy RemoteSigned
  • Execute the script with a command line similar to the following:
    • .\E2K7onW2K8Install.ps1 installdir:d:

As with my last blog, you can download the scripts for the Windows 2008-based lab from here.

- Robert Gillies

Version history
Last update:
‎Sep 03 2008 02:53 PM
Updated by: