Skip navigation

 

Background

 

This procedure is for when you absolutely can’t do anything with your Exchange 2007 Server. This procedure will help when: 

  1. Exchange is not functioning
  2. Your restore hasn’t worked, or your backups are non-existant or unreliable
  3. Your databases are still intact
  4. You cannot uninstall or reinstall Exchange 2007 by normal means

One way to resolve this problem might be to try to mount your databases on another functioning Exchange 2007 server. Once you have mounted your databases on another server, you can then work on the non-functioning server by following the manually uninstall step below. 

A good article for mounting your databases on another server is available at the link below: 

http://www.msexchange.org/tutorials/Moving-Exchange-Server-2007-database-Mailbox-servers.html 

But if you don’t have another Exchange 2007 server handy, you might like to consider the procedure below: 

  

WARNING 

Only consider the procedure below if you have exhausted all other avenues, including: 

  • Reviewing all servers in your network; the unavailability of DC’s, GC’s and DNS servers, or problems with DNS can lead to unpredictable problems with Exchange.
  • Restoring from backups
  • Escalating to Microsoft’s PSS if that is an option available to you

The procedure below was tested by myself in my Test Lab and so I can verify that it works. But every organization is different and so you should proceed with caution and at your own risk. You should revise the whole of this blog before proceeding.

 

Manually uninstall

Manually removing Exchange 2007 is not supported by Microsoft. If you take this path, Microsoft will likely not assist you should it go wrong. Microsoft would want you to remove Exchange 2007 from the control panel, but you have tried that and it has not worked. 

Before you follow this procedure, you will need to locate the Windows Installer CleanUp Utility. This was a utility that was primarily used to cleanup a failed Office install, but known to cleanup other Installer failures. Unfortunately, Microsoft has now removed it from their download sites – they had found that there were some situations where the Utility might damage other components.

 

Perform a search on the Internet for MSICUU2.exe. Take care to locate the right file – it’s a zipped exe with a size on disk of 352KB.

 

When you are ready, take the following steps:

1. Run setup /m:uninstall

You may find that if you were unable to uninstall Exchange 2007 from the Control Panel, you may not be able to perform the above step either. Don’t worry. Move on to step 2.

2. Stop and disable all the Exchange 2007 services

3. Use Registry Editor (Start->Run->Regedit) to remove these Exchange related registry keys:

  • HKLM\SOFTWARE\Microsoft\Exchange
  • HKLM\SYSTEM\CurrentControlSet\Services\MSExchange* (all the keys starting with “MSExchange”)
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Exchange

4. Remove the entire Web Server role (don’t forget to reinstall afterwards as it’s a prerequisite for Exchange 2007!)

5. Remove the Exchange 2007 server from Active Directory using ADSIEdit. Action-Connect To. And then in the Configuration Settings window, select the Configuration context and click OK. See image below.

6. In ADSIEdit, expand Configuration through to CN=Services.

7. Expand Services. Expand CN=Microsoft Exchange. Expand CN=Your_Domain. Expand CN=Administrative Groups.

8. Expand CN=Exchange Administrative Group (FYDIBOHF23SPDLT)

9. Expand CN=Servers

10. Delete the target server. It will be of the form CN=<Server_Name>.to your domain CN=Domain. If you are unable to find your server listed as described, you may need to use LDP.EXE to firstly locate it.

11. Use Windows Explorer to delete:

  • C:\Program Files\Microsoft\Exchange Server
  • C:\ExchangeSetupLogs

12. Run the Windows Installer CleanUp Utility to remove all the Exchange related info from the installer database.

13. Remove the target server from any Exchange security groups.

 

  

Install Exchange 2007

Install Exchange 2007 by running setup normally. I would recommend that you install to the same service pack level as you had before your server disaster.

I came across a problem as I tried to install Exchange 2007 where I got an error as setup proceeded to Copy Exchange Files:

Error:

Error code is 1603. Last error reported by the MSI package is ‘Could not open key: UNKNOWN\Components\… Verify that you have sufficient access to that key, or contact your support personnel.

This problem may have occurred as a consequence of using the Windows Installer Cleanup Utility. Hopefully you won’t come across this problem. But to keep this blog short, I describe how I resolved this problem on another blog:

https://messageflip.wordpress.com/2010/07/30/cant-reinstall-exchange-error-code-1603/ 

 

 

Test Database Integrity by using eseutil

If you have gotten to this stage then your Exchange Server has been restored. If this was a mailbox server, then you will be looking to see if you can restore your databases.

Before you can progress, you’ll want to be sure that your databases are OK by verifying its integrity. You can do this by following the steps below:

  1. Open a command prompt window.
  2. Navigate to Exchange’s binary folder (usually at c:\Program Files\Microsoft\Exchange Server\Bin)
  3. Type in the following: eseutil /mh  (see image below).

 

 

You will notice that, in the image above, the State is ‘Clean Shutdown’.

This indicates that the database in this instance had shutdown correctly before the disaster occurred. The chances of this database being restored to the newly recovered server are very good. If your result for any of your databases are anything other than a ‘Clean Shutdown’ then you will need to use eseutil to repair the database. A discussion on repairing the database using eseutil is beyond the scope of this post, but there is plenty of information on the Internet on this procedure. I include a recommended link at the end of this post. If you need to repair any database, I would recommend taking a copy of your database firstly.

 

Mounting the Database

Once you have verified that your database(s) are good, you might like to take the following steps to mount your database:

1. Create a brand new database in a temporary folder on a disk and name this database the same as the old database that you are recovering

2. Mount the database

At this point, you have mounted a new, blank, database on your server. This database has exactly the same name as the old database.

3. Set the database as being able to be overwritten by a restore

You are now preparing the new database to be swapped out for the old database of the same name.

4. Dismount the new database

5. Rename the new database to *.old.

6. Copy the original database to the new temporary location.

7. Mount the database

The original database has now been recovered.

8. Move the database back to its original location on disk

9. Repeat steps 1-8 for any other databases that need to be recovered.

10. Delete any temporary *.old database files that you have used.

  

Outlook Problems?

At this stage, you have now recovered your server and your databases. But if you start Outlook you might see the following message:

As far as Outlook is concerned, the original server is not reachable. This has likely happened because certain user attributes have changed, or have even been deleted.

You can use ADSIEdit to see where the problem is. Navigate to a user and examine the user’s properties (see image below).

The two attributes to check are homeMDB and homeMTA. They follow a form similar to these below:

CN=Mailbox_Database_Name,CN=Storage_Group_Name,CN=InformationStore,CN=Server_Name,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Domain_Name,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Domain_Name,DC=com

CN=Microsoft MTA,CN=Mailbox_Server_Name,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Domain_Name,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Domain_Name,DC=com

If your respective attributes are different or missing, you will need to edit and then replace them for each user. You can do this within ADSIEdit and it is not too onerous if you have only a few users to edit. You can also use ADSIEdit to get key users up and running.

If you have more than a few users, I believe that there might be a Windows PowerShell method to deploy these changes to an OU. It should be fairly straightforward to develop a script to make the changes too, but this is beyond the scope of this article.

I hope that this has helped you in some way.

REFERENCES

Manually removing Exchange 2007.

http://blog.koenvermoesen.be/2009/01/23/manually-remove-exchange-2007/

eseutil repair options:

http://technet.microsoft.com/en-us/library/aa998249(EXCHG.80).aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: