How to remove Multiple User vaults Enterprise Vault

There seems to be very limited options in Powershell when it comes to Enterprisevault.

In this blog I am sharing a experience of Enterprisevault 9.0 where we have to cleanup around 6000 User Vaults & PowerShell is a no go here because No such cmdlets exists.

So let ‘s get back to old school & use some other methods for speeding up the things šŸ™‚

Some of you might have already guessed that I will be using some SQL way šŸ™‚

Yes there is a inbuilt SQL stored procedure that I will use along with Notepad ++Ā  else it would be very clumsy task.

Let’s start & get the List of User Alias or SaMaccount Names that needs removal.

Prepare the below command using Notepad++ (SameĀ methodĀ we used in one of the olderĀ post of DL upgrade a year ago)

Copy the ids as below –>Ā Notepad++

Capture

Click on Search –> Replace (You can use Cntrl + H as well)

Capture

Now use the Regex Pattern – Ā Ā ^(.+)$ (Find What)

Replace with : or MbxAlias = ‘\1’

Capture

Hit Replace All to see the magic šŸ™‚

Capture

Now you need to connect SQL server with SQL management studio & run the below query on EnterprisevaultDirectory databaseĀ in-order toĀ get the Defaultvaultid as that would be used when running theĀ stored procedure.

select MbxNtuser,MbxAlias,DefaultVaultId from ExchangeMailboxEntry

where MbxAlias = ‘User1’

or MbxAlias = ‘User2’

or MbxAlias = ‘User3’

or MbxAlias = ‘User4’

or MbxAlias = ‘User5’

or MbxAlias = ‘User6’

Note: I have removed the first “or”, rest is just copy pasted.

Result from SQL:

Capture

Now copy this result & have the default vault ids in Notepad++

Follow the same procedure & build the command:

exec DeleteArchive ‘value copied to the clipboard for the Archive ID’

exec DeleteArchive ‘value copied to the clipboard for the Archive ID’

exec DeleteArchive ‘value copied to the clipboard for the Archive ID’

Stop the EV Storage service on the servers hosting the Vaults.

Open SQL management studio & run the command

use EnterpriseVaultDirectory

exec DeleteArchive ’16C529AC6165F6D479B0048769E64D03XXXXXX’

exec DeleteArchive ’16A30218AB8B4B6488BA98951679C2XXXXXXX’

exec DeleteArchive ‘1421E7F03089D0142BCD89459298XXXXXX’

exec DeleteArchive ’16E402CBA5D1C2648BEB5DC782AD6BXXXXX’

exec DeleteArchive ‘1BACE631613CB064BBEB6C13D2D515XXXXXX’

I always runs in the chunks of 500 or 1000, few might result in obvious errors because of legal holds, rest all will run fine.

After work is finished , start the EV Storage ServiceĀ .

If you provision the user vaultsĀ Ā based on AD group than remove these users from that group as well, use one Ā of my scripts (search in my blog or technet gallery, you will easily find examples)

Finally you have to remove these users from the “ExchangeMailboxEntry” table , for this as well, you can use the same approach of Notepad++

delete from ExchangeMailboxEntry

where MbxAlias = ‘user1

or MbxAlias = ‘user2’

or MbxAlias = user3′

Let me know if you have any questions on the above process.

Note: Please take VeritasĀ buy-in before following this method in your environment..

Regards

Sukhija Vikas

http://msexchange.me

Advertisements

3 thoughts on “How to remove Multiple User vaults Enterprise Vault

  1. Hi Vikas,

    Is there a way to export the Data into a PST file before deleting them. This can be done using GUI, but it will take a lot of time and effort. I am looking for a shell based method to export Vault’s Data into PST files.

  2. Journaling Vault is gone, which is what I wanted, but now How to reclaim space after running below mentioned query:
    use EnterpriseVaultDirectory
    exec DeleteArchiv ‘VaultID’

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