Forcing the removal of Exchange Attributes on a Directory User (the RemoveExchangeAttributes tool)…

There have been may 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 which 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.

This is exactly where I found myself again recently within my LAB environment.
Essentially like many Exchange Admins I have been testing Exchange 2010 (the initial CTP build).

However due to work commitments I had not had a chance to get really deeply involved in with it, so with the fact that I had more time recently I decided to uninstall the CTP builds and replace them with the RC build.

I uninstalled the CTP from my LAB 2008 servers (which required quite a bit of messing around with the guts of AD) – I completely forgot to remove the mailboxes from the user accounts in AD (this will give you and idea of how much messing around in AD that I needed to do as normally you cannot uninstall Exchange from a MBX server unless you have moved – or removed the accounts).

This resulted in the administrator account which was resident on the previous CTP 2010 mailbox server being orphaned from my new Exchange 2010 MBX servers (which was to be expected) – I jumped into the Exchange Management Console and navigated to [ Microsoft Exchange –> Microsoft Exchange On-Premises –> Recipient Configuration –> Mailbox ] – see below;


When creating a new mailbox and choosing the “ [ Existing users –> Add ]” – see below;


The select user process would not find the Administrator Account (or for that matter – any of the 500 test accounts that no longer had mailboxes – as they were configured to do so on the previous CTP build) – see below;


So with this in mind ( and given that I had come across this so many times before) I decided that I was going to write a command line based tool which (when combined with a script) can be used to selectively remove the Exchange attributes from an AD account so you can create New mailboxes within Exchange.

Today I am pleased to announce the release of the Exchange “RemoveExchangeAttributes” tool.

Download / Installation:

You can download the tool from the following location:

ESEUtilGUIIcoRemove Exchange Attributes Tool – Version 1.0 – [11KB]

It should be downloaded into “c:\RemoveExchangeAttributes” – on either a Domain Controller within the Domain where the previous mailbox server was resident or onto the new Exchange Server.


  • .NET 2.0
  • Exchange 2007 / Exchange 2010 (tested against the RC build)


NOTE: This tool is destructive – it will forcibly disassociate a mailbox from its AD account – this process is not easily reversible and should not be performed unless you have good reasons (like the examples used in this article). This is very much use at your own risk – neither Microsoft nor I will be able to support you if something goes wrong – it should only be used in the most severe of circumstances – you have been warned!

The tool weighs in at 11KB in size and when executed (from the Windows Command Prompt) require two parameters: which are as follows:

<samAccountName> info - or <samAccountName> remove

The operating parameters “info” and “remove” are CASE Sensitive and should be in lower case. Therefore usage examples are:

RemoveExchangeAttributes.exe  administrator info


RemoveExchangeAttributes.exe  administrator remove

Below is an example of the tool being executed in “info” mode:


Below is an example of the tool being executed in “remove” mode:


After executing the tool in remove mode against the chosen account(s) – open the Exchange Management Console and you try to create a new user from an existing account (as per above) you should now see the missing accounts – see below;


So if you should find yourself in the same position as myself above – I hope that you find this tool useful!


  1. This is an amazing tool!!! I had an exchange disaster that went on for two days and finally I found this tool which ended the horrible nightmare. Thanks so much!!!

    1. Thanks Ralf – that works ok if you are using Exchange 2003 and there is not something fundamentally wrong with the mailbox. The tool is targeted at Exchange 2007 specifically – where I have seen the cmdlets in the article fail and just to reiterate – there is no supported means of doing this outside the cmdlets – this tool is for use in non-production environments only.

      1. Hey Andy,

        ah ok, i hab some trouble with exchange 2003 (on a sunday..
        i had to fully reinstall the sbs server, i created the ad-users (with!) exchange mailboxes and after this i restored a offline backup of exchange. this was the failure because i cant reconnect the mailboxes as the users had mailboxes – therefore i had to remove the ex-attributes so it was possible to reconnect the restores mailboxes.

        so, if some one has to reinstall sbs:

  2. Hi Mr. Grogan,
    You are a gentleman and a scholar thank you for creating this for us to use. I am wondering if you are able to list the attributes that this program removes as I have to match them up with an office365 synced AD attributes just in case this will affect the mailbox on Office365.

    Thank You

  3. This tool looks great, however I am a bit fearful to use it on a server with preexisting issues.
    Would you be able to specify the attributes that are removed by the tool? I’d much rather go in and manually remove them. Thanks in advance.

  4. Great job! Successfully tested on W2k16 and Exchange 16, works like a breeze!
    Thanks a lot and cheers!

  5. I had this issue, I had already removed the Legacy Exchange DN manually, ran this tool in info mode, nothing was found to remove. I tried running Connect-Mailbox in Powershell (got identity guid from Ex2016 Admin Centre – error was “the user’s AD account must be logon-enabled for the user’s mailbox”. I enabled the account in AD and was then able to connect the mailbox to it, simple, not sure why that matters though.

  6. This worked like a charm on our 2010 environment. Had an issue exactly as described, and the tool cleaned it right up.
    Do have a question.. You’ve reduced the tool to a short sweet executable. Can you provide a few more details on the attributes that are being reset?

  7. Well, this fixed my problem (so thank you) but I’d like to know how. When I did INFO it came up with nothing except the DN but running it in REMOVE mode fixed the issue.

    Any chance you can tell us what attributes the program actually modifies?

  8. Apologies to all who have asked what Attributes the tool removes. The original aim was to remove problem mailboxes from Exchange 2010 test environments to allow for the removal of servers. All my tools are not supported for production use. They might work in later versions – but that doesn’t mean that they clean everything.
    Exchange on-prem has changed hugely since I wrote the 2010 version of the tool which includes the AD properties that constitute a mailbox user.

    What I will say is at the time, the tool targeted all Exchange attributes exposed in Active Directory via ADSI.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.