Renaming a 2003 AD domain that has Exchange 2007

Here’s an unpleasant little fact you only find out if you need to: while you could rename a domain that hosted Exchange 2003, this functionality has been removed with Exchange 2007.

Hmm. So what if you need to? Well a customer is insisting that it must be done, so I’ve had to do some investigations.

Note that this article is based on lab work – I will post again after the actual rename, assuming I can’t swing Option 1 below.

Option 1: Try to talk people out of it

It’s not just Exchange that will be affected. If you have a CA Server you will have to reinstall it with the new name, and then recreate all your certs.  Your DNS zone structure will have to be recreated. And of course every computer attached to the network will need to be rebooted – probably more than once. You will have to track down every script, service and network device that has the domain name hardcoded somewhere… Basically, it’s not going to be simple, you may well have to reinstall some services from scratch, and you could have niggly problems going on for weeks.

But if that doesn’t work…

Option 2: Migrate to a new forest

This is where you create a new forest with the new name, install a new Exchange 2007 server into it, and then use tools like ADMT, Gpolmig and Move-Mailbox to shift everything over. This approach has several factors in its favour:

  • The new forest will be completely free of the old name,
  • Migrations are well understood and there’s plenty of documentation out there,
  • The old domain and, importantly, the old Exchange server are untouched and available for rollback,
  • With an inter-forest trust, it should be possible to move services over in stages.

Of course you’re going to need some new hardware, in particular that new Exchange server. Which would be rather annoying if you’d only recently installed the “old” one.

Option 3: Uninstall Exchange 2007 , Rename the domain, Reinstall Exchange and Restore the mailboxes

Now you can use rendom.exe to rename a Windows 2003 domain once you have uninstalled the Exchange 2007 server. There is no need to do anything special with AD or its schema – just get rid of that Exchange 2007 server and you’re ready to go.

It’s all a bit scary though. To uninstall Exchange 2007 you must first run the disable-mailbox cmdlet against all users – this effectively removes all Exchange-related information from the user objects, including quotas and delegations. You then have to remove your Mail and Public Folder databases. Yikes!

After the rename it is simple enough to reinstall Exchange 2007 (no need to forestprep as the schema changes are still there) and create new mailboxes for all the users…

But here’s where it all went pear-shaped in my test environment. It is not possible to restore an Exchange database over the top of an existing one, you have to go via a Recovery Storage Group,  BUT the restore utility would not restore to my new mailboxes because the mailbox GUIDs did not match! Of course – I’d created new mailboxes.

It is supposed to be possible to restore a mailbox to a folder inside a different mailbox – but my tests on this were not exactly promising – basically, I could not get it to work at all.

So we have a scary, risky uninstall of Exchange 2007, with a messay, potentially unworkable restore procedure. Not great.

Option 3.1: Use PSTs instead of RSGs

So the other idea is to export all the mailboxes to PST using export-PST before uninstalling Exchange 2007. Afterwards you should be able to import into the new mailboxes using import-PST.

But I haven’t actually tested this, because the whole uninstall-Exchange-from-production-environment thing has just got me too worried, and I have no intention of doing it for real.

Option 4: Like 3, but restore the entire Exchange Server

I haven’t tested this one because I don’t see how it would work. A crashed server can be rebuilt using the /RecoverServer switch – however all the information must still exist in AD. If you have actually uninstalled Exchange (essential prereq for renaming the domain) then the info is gone from AD and this switch won’t help.

The same goes for trying to restore the entire server image from backup. Exchange is too emeshed into AD, and if you’ve gone through the uninstall, you can’t fool it by just popping the server back up.

Option 5: Install Exchange 2003

Now I thought this was a pretty neat idea. You install an Exchange 2003 server, migrate everything to it (including the Public Folders), and then proceed as above with the uninstall-rename-reinstall activities. You could probably actually keep mail live through most of it, nothing gets deleted, and you could use a temporary server (assuming you had enough disk space).

But again it all fell through for me. Turns out you can’t install Exchange 2003 into a domain that’s only had Exchange 2007. The forestprep step fails, and then the installation fails because forestprep wasn’t done.

I know it is possible to run Exchange 2003 and 2007 in the one domain – but 2003 has to be there first. It may be possible to install an Exchange 2003 server into a domain that had Exchange 2003 before, but I haven’t had a chance to test that one out – and as it’s not relevant to my current problem, I won’t be pursuing this option any longer.


Failing Option1, I’ll be going for Option 2.

If you do need to do this, all I can say is: test, test, test, plan, plan, plan.