This content is part of the Essential Guide: The essential guide to PowerShell in Exchange
Manage Learn to apply best practices and optimize your operations.

Exchange 2010 migration: Preparing Active Directory using PowerShell

Your Active Directory forest has to meet some prerequisites before migrating to Exchange Server 2010. These Powershell commands let you verify and prepare AD for the move.

Before performing an Exchange Server 2010 migration, you have to make sure Active Directory meets certain prerequisites....

Thankfully, there are a number of PowerShell cmdlets to help you prepare your Active Directory forest for the move.

Validating your Active Directory forest
Before deploying Exchange Server 2010, your Active Directory forest must meet several different conditions:

  • There must be at least one global catalog server running Windows Server 2003 SP1 or higher. This server must also exist in the same site that the Exchange server gets installed on.
  • The Active Directory forest must run forest-functional level of Windows Server 2003 or higher.
  • The domain you’re going to install Exchange in must be Windows Server 2003 or higher.
  • The server with the schema master role must run Windows Server 2003 SP1 or higher.

The easiest way to check if Active Directory meets these prerequisites is to open a PowerShell 2.0 session -- not an Exchange Management Shell (EMS) session -- and enter the following command:

Get-ADForest | Format-List Name, GlobalCatalogs, ForestMode, Domains, SchemaMaster, Sites

After executing this command, you will receive the forest name, the names of the global catalog servers within the forest, the forest-functional level, the names of the domains within the forest, the schema master name and the names of the Active Directory sites (Figure 1). All of this information is important when preparing your Active Directory forest for an Exchange 2010 migration.

Use PowerShell to get info about your AD forest.

Figure 1. Use PowerShell cmdlets to extract information about your Active Directory forest.

Checking the forest-functional level
As you can see in Figure 1, my Active Directory forest is already running at the Windows 2003 forest-functional level. If necessary, you can upgrade the forest-functional level using the following command (Figure 2):

Get-ADForest | Set-ADForestMode –ForestMode Windows2003Forest –Confirm:$True

Upgrade your forest-functional level.

Figure 2. You can also upgrade the forest-functional level using PowerShell.

Checking server versions
Both the Active Directory schema master and at least one global catalog server in each site must run Windows Server 2003 SP1 or higher. The Get-ADForest command revealed the identities of your global catalog servers and the schema master. However, you still need to determine which version of Windows those servers are running.

Enter the command below, but make sure to substitute your server’s NetBIOS name for <servername> and add a dollar sign ($) to the end of your server’s name. Otherwise, the command won’t work.

Get-ADComputer –Filter {SamAccountName –EQ “<server name>$”} –Properties OperatingSystem, OperatingSystemServicePack | Format-List Name, OperatingSystem, OperatingSystemServicePack

You can see the command in action in Figure 3.

Use PowerShell to get operating system info about your servers.

Figure 3. Use the Get-ADComputer cmdlet to retrieve OS information for your servers.

Checking the domain-functional level
The next thing that you need to do is verify that your Active Directory domain runs at Windows Server 2003 functional mode or higher. You can verify your domain-functional level with the following PowerShell command:


Again, if you need to raise the functional level, use the following command:

Set-ADDomainMode –Identity <your domain’s FQDN> –DomainMode Windows2003Domain

You can see these commands at work in Figure 4.

Check your domain-functional level.

Figure 4. You can verify your domain functional level using the Get-ADDomainMode cmdlet.

Checking Exchange Server versions
The final step is making sure that your existing Exchange servers are Exchange Server 2003 SP2 or higher. You can easily verify this using PowerShell, but unlike the other commands I’ve shown, this command must be executed through the Exchange Management Shell on an existing Exchange 2007 server. The command is:

Get-ExchangeServer | Format-List Name, ServerRole, Edition, AdminDisplayVersion

The PowerPRO GUI -- MobileShell interface

Figure 5. Use PowerShell to check which versions of Exchange are currently running.

If you don’t have any Exchange 2007 servers, you’ll have to verify your Exchange Server versions manually, without PowerShell.

Once all of these prerequisites are met, you can prepare your Active Directory for Exchange 2010.

Brien Posey
is an eight-time Microsoft MVP with two decades of IT experience. Before becoming a freelance technical writer, Brien worked as a CIO for a national chain of hospitals and healthcare facilities. He has also served as a network administrator for some of the nation’s largest insurance companies and for the Department of Defense at Fort Knox.

Dig Deeper on Exchange Server setup and troubleshooting

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.