Removing Exchange Attributes by Force and in Bulk in Exchange 2010 and 2013 – Revisited…

by Andy Grogan on December 30, 2012 · 3 comments

in Exchange 2010 (Admin), Exchange 2010 (Mailbox), Exchange 2013 (Admin), Exchange Programming .NET

Around three years ago I released a small command line based tool which forcibly removed the Exchange related attributes from a user within Active Directory. The original rationale behind writing the tool was:

There have been many points over the years where I have personally (not sure if anyone else out there has encountered this) where I have forcibly needed to disassociate (or remove) a user account from its mailbox.

Normally this would be accomplished via the Exchange Management Shell using the Disable-Mailbox or the Remove-Mailbox -StoreMailboxIdentity -Database CMDLETS in a production environment.

However if you have found yourself in the situation where the Mailbox Server has been rebuilt without an suitable backup – or more to the point where Exchange has been forcibly removed from Active Directory which results in having a number of accounts which point to a Mailboxes on a Mailbox Server that no longer exists – I am sure that you are aware of how much of a pain it is to rummage around in AD – remove the required attributes for all of those accounts and reconnect them.

Recently I found myself in the situation again (through me messing something up in my lab (again!)) – and I needed to remove the attributes from a number of accounts. I went to my old tool – and found that whilst it worked ~ it was not particularly good when you needed to use it in bulk.

I also found that due to the various changes that have happened in Exchange since I released the original code – there were a number of attributes that the tool does not clear up as they were not present on the user properties at the time (there have been a number of schema updates which have added properties to user mailboxes).

So, I decided to rewrite the tool so that it was capable of working on multiple mailboxes and add in some additional attributes to be removed that have been added into Exchange since version 1.0 of the tool was published.

Warning

The REA is HIGHLY destructive – it is designed for use in very particular circumstances, and only as a last resort. I cannot be held responsible for any data loss that might occur as a result of using this tool. Please ensure that you understand the ramifications of using this tool against a WORKING mailbox(es):

  • The Active Directory Account will be orphaned from the Mailbox within the database

This tool is designed for use against Active Directory accounts where the mailbox, mailbox database or server are no longer available and the normal Exchange cmdlets do not work.

Microsoft does not, and will not support this use of this tool – use at your own risk!

Requirements

  • .Net Framework 3.5 Service Pack 1
  • Exchange 2010 and Exchange 2013 – Only
  • Needs to be executed in the context of a Domain User account

Download

30-12-201215-36-37[ REA – Version 2.0 – 1.6 MB ]

Installation

Double click on the installation binary file “REA.exe”.

30-12-201215-36-37

You will be asked if you wish to continue with the installation – click on the “Yes” button if you wish to proceed.

30-12-201215-37-17

Select your desired location for the main tools binary to be placed (remember this location as the installer does not create icons in the Start menu) When done click on “Unzip”.

30-12-201215-38-40

When the process has completed you will be presented with the “Successful” dialog box – click on “OK” to exit.

30-12-201215-39-31

Start the tool by double clicking on the tool binary file from the location where you installed it during the installation process.

Usage

When the tool has executed – in the “samAccountName” field type in the account name of user that you wish to forcibly remove the attributes of.

30-12-201215-42-05_1

When done, click on the “Search” button.

30-12-201215-42-05_2

The account details pane will populate – review the information to ensure that you are happy to proceed.

30-12-201215-42-05_3

Click on the “Add >>” button which will transfer the account to the “Selected Mailboxes” window. Repeat the process to add further accounts for processing.

30-12-201215-48-09_5

When ready – click on the “Remove” button. The tool will then process each account and remove all of the relevant Exchange attributes from the account.

30-12-201215-48-09_6

The old version of tool will remain available as it is still compatible with versions of Exchange from 2003 to 2007.

Social

{ 3 comments… read them below or add one }

Martin Canias September 11, 2014 at 5:58 pm

Hi Andy,

I am in the situation where i had a child domain that was removed, but the user mailboxes for that domain are still in exchange 2013. The Exchange is installed in the root domain. No one of the delete/remove cmdlets work because the child domain is no longer available. Does your tool is usefull in that scenario or needs to be run in the child domain where the users where defined? If it is not usefull, do you know which is the way to remove those mailboxes from the exchange server? Many thanks

Reply

Conrad Lawes November 15, 2014 at 3:09 am

Martin,

I’m in same boat as you. I have mailbox that has been orphaned because the user account resided on a child domain. The child domain has been removed from the forest. So any attempt to remove or disable the mailbox fails because the user account cannot be found. REA will not work for this scenario. Did you find a solution to this problem?

Reply

intretinere calculatoare June 21, 2017 at 2:42 pm

Great website. Plenty of useful info here. I’m sending it to some friends ans
also sharing in delicious. Annd of course, thanks
for your effort!

Reply

Leave a Comment

Previous post:

Next post: