This is just a quick guide to decommission an old Exchange server 2007, since now 2010 and 2013 and even Office365 are everywhere, 2007 is considered obsolete same as 2003 during the days of 2010…
I am not going to get in details about this, just I will summarize the guide by putting the steps and the link to information/how to do it… the whole process consists of the following steps:
Step 1: Remove old OAB: http://social.technet.microsoft.com/Forums/en-US/f26f4d92-4792-4d28-9617-ff9095d94596/exchange-server-2007-error?forum=exchangesvrsecuremessaginglegacy (follow the first part steps 1, 2, 3, 4 from the answer).
Step 2: Remove the folders replicas from the public folders database if it exists: http://technet.microsoft.com/en-us/library/bb201664%28v=exchg.80%29.aspx (follow the section “To delete user and system public folders“)
Possible (almost sure) errors: Object is read only because it was created by a future version of Exchange: http://social.technet.microsoft.com/Forums/en-US/f26f4d92-4792-4d28-9617-ff9095d94596/exchange-server-2007-error?forum=exchangesvrsecuremessaginglegacy (follow the last part steps 1, 2, 3 from the answer).
Step 3: Remove public folders database itself: http://technet.microsoft.com/en-us/library/aa998329%28v=exchg.80%29.aspx (follow the steps in section “Procedure“)
That should cover the most common issues/problems while trying to remove an old Exchange 2007 from the organization…
After the above actions have been taken, you can finally run the Exchange uninstall wizard to remove it from the organization.