This is an interesting little subject (well it was for me anyway), I have been working with a chap called Phil in the MSExchange forums on how to recover data from a recovery storage group (RSG).
Initially Phil was having some problems getting the Store Database to recover to the RSG (this he was doing in a test lab), however after some troubleshooting we managed to get the database to restore to the RSG, however, Phil could then not use the ESM to merge the data back into the users mailbox in the Primary Store by using the “Recover Mailbox Data” task from the ESM or by using EXMERGE
Initially I focused on why EXMERGE could not export the data from the RSG that Phil had, so I asked to post the EXMERGE.log file – upon reviewing the file I saw the following entry:

I discussed this with Phil as I had already begun to suspect that we were dealing with a mailbox GUID issue (the GUID of the mailbox in the RSG does not match the GUID of the user in AD, therefore neither the ESM or EXMERGE will be able to see the mailbox in the RSG as a recoverable item).
Phil explained to me that the user account in AD had been deleted and the mailbox had been purged from the original store – ah hah! this is why we cannot get any back with either the ESM or EXMERGE.
Before we proceed I think a little explanation is in order;
Exchange Mailboxes normally exist in one of the three states –
- Connected (The mailbox has an associated AD account which contains the correct msExchMailboxGUID)
- Disconnected (The msExchMailboxGUID is not allocated to any Exchange user)
- Purged (The mailbox and all its contents are no longer located in the Database – you can only purge Disconnected mailboxes)
If a mailbox exists in a disconnected state then programs like EXMERGE cannot login and extract (or import) data.
Although technically mailboxes in a RSG are disconnected by default, they are linked to mailboxes in the original store via the msExchOrigMDB attribute and the mailbox GUID if a mailbox exists in the original store with the same Mailbox GUID then EXMERGE will work.
Now if you read a number of Microsoft articles on the web they will tell you that if the Mailbox has been purged from the Original store, then your only option is to restore the database from Backup, or use the recovery storage group to Mount the Database and then perhaps cut over the mounted Database files to the normal and correctly name storage group – all of which is a little messy, so the following is what I worked through with Phil, from now on all examples will be from my home Lab;
Firstly what I did was create an account with a mailbox called “Andy.Grogan” in my lab environment, I then added in some data to the mailbox (an old pst that I had lying around) using EXMERGE.
I then took a backup of the Information Store (using NTBackup) – I then deleted the “Andy.Grogan” account from AD and purged the mailbox from the Information store.
So I am now in the position where I need to recover the mailbox to the Information Store, but I have deleted both the original account and the purged the mailbox (exactly the position that Phil was in).
Step 1 – Restore the backup of your Information Store to the Recovery Storage Group
In order for this step to work you will need to have a freshly created recovery storage group, with the Database that you intend to restore added – this will create a unmounted Database in the location that you specify – do not mount this database until you have completed the restore.
Ensure that you normal mailstore does NOT have the check box “The Database can be overwritten by a restore” checked – this is very important.
The following is the process that I used to restore the IS data to the RSG:
Open NTBackup and select restore (at this point the original store should STILL be online, and the RSG created with the databases added – but this should be off-line (also ensure that the “this database can be overwritten by a restore is set on the RSG Database ONLY).
Select the restore tab (do not worry about the Restore Files to saying original location), and choose your backup set – then click on start restore.
You will be asked where to restore to (leave this as the server you wish to restore to should be configured) then set a path for the transaction logs and patch files If you do not intend to restore addition logs tick the box that says “Last Backup Set” – then click ok.
The restore will then process (you will not be asked anything about the RSG).
When the restore has finished – wait a few minutes then mount the RSG.
If you get an error message when mounting the RSG database, ignore it, wait a couple of minutes then try again (it relies on Directory Replication).
When you have completed the above and mounted the RSG you should see something similar to the example below showing in the ESM:

If you attempt to use the ESM to recover the mailbox data for “Andy.Grogan” using the “Recover Mailbox Data” wizard you will get an error at the end of the process – this is due to the fact that the original mailbox does not exist in the store.
Step 2 – Configure the GUID using EXMERGE
What we need to do now is recreate the “Andy.Grogan” account and Mailbox in the original storage group – do this by using ADUC – please ensure that the account naming (for example, mailbox alias and account name) are the same, you do not need to worry about passwords.
We should now have our account created – but at this stage we are still not in a position to restore data, what we need to do is run EXMERGE against the RSG which will fail – this is expected, because it will create a log file that contains a very important piece of information – the original GUID of the Mailbox.
Run EXMERGE – choose the Extract or Import (Two Step Procedure).
When asked choose step 1 (Extract data from an Exchange Server Mailbox), when ready click next and complete the information about your Exchange Server and Domain Controller.
On the next screen tick the box which corresponds to your RSG – an example is below:

Click on the next button, EXMERGE will then go an enumerate the RSG store – you will receive an error message about some mailboxes not being able to be displayed, the screen will then change again to list the mailboxes that you can export from – you should note that the Andy.Grogan (or the Mailbox that you are working with) is not there – the following is an example of what you might see:

It is at this point that you can click on the cancel button, as enough data will have been written into the EXMERGE log for us to proceed.
Step 3 – Configure the new account in AD with the msExchMailboxGUID of the old account
This is where is gets really cool, what we need to do is open up the EXMERGE.log file (which is located typically in the same directory as EXMERGE).
Scroll down to the bottom of the log and you will see an entry which looks like the following:
Error! Cannot identify the user with the msExchMailboxGuid \A48\1F\2EB\1E\1BB\B8R\B1jO\15\A8f. The legacyExchangeDN is /O=COREGENDYN/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=ANDY.GROGAN.
The part of this that we are interested in is the \A48\1F\2EB\1E\1BB\B8R\B1jO\15\A8f (remember there is chance that this string will be different on your installation) this is the ASCII representation of the GUID, what we need to do here is convert this into readable form for the ADSI edit program.
Firstly remove all of the trailing slashes from the string (but maintain the spaces) – like so: A4 08 1F 2EB 1E 1BB B8R B1jO 15 A8f
Now what you should notice about the above is that we some groups of 2 digits, some groups of 3 and some of 4 – for the groups of 3 digits we need to count in two from the left and place a space between the right most digit and in the case of a group of 4 we need to put a space between the first two most digits and a space between the last two – like so: A4 08 1F 2E B 1E 1B B B8 R B1 j O 15 A8 f
What we have to do now is substitute all of the single spaced digits for their HEX values – so you will need a ASCII to HEX converter (there is a good one here) remember that lower and upper case letters have a different Hex value, therefore case is very important.
Looking at the example above we are going to convert the value for B,B,R,j,O and f – when you have done this your string should look like the following: A4 08 1F 2E 42 1E 1B 42 B8 52 B1 6A 4F 15 A8 66
Just in case you are a little wolly on what we just did, below is an example of the ASCII to HEX conversion that we have implemented:
(B=42,R=52,j=6A,O=4F,f=66)
Now that we have done the conversion we are left with what is the old msExchMailboxGUID of the account that we deleted (cool huh?) what we now need to do is set this attribute on the new account that we created for “Andy.Grogan” (or your account) in AD – for this will will need ADSIEDIT which can be installed from the Support\Tools folder on the Windows 2000/ 2003 CD-ROM or can be downloaded from HERE
When you have ADSI edit installed open it an navigate to the account that you are working with (or the “Andy.Grogan” account) – the following is an example of how to do this:

You should note that in order to change to AD Attribute values for accounts using ADSI edit you will always be in the Domain partition – however the location of the accounts can vary depending on your OU structure – in the example that I have given the user is in the default “Users” container.
When you have found that account that you are working, right click the entry in ADSI edit and select “Properties” and you will be presented with the dialog box which looks like the following:

You can un tick the “Show Mandatory Attributes option” and tick the “Show only attributes that have values” then from the section entitled “Attributes” you will need to find the msExchMailboxGUID entry (see example above) when you have located it click on the “Edit” button and you will be presented with a screen that looks like this:

What you need to do is copy the A4 08 1F 2E 42 1E 1B 42 B8 52 B1 6A 4F 15 A8 66 into the “Value” area that is provided and then click OK, then click Apply and OK again then exit ADSIEdit.
You will now need to Restart the MSExchangeSA service on your Exchange Server (note this will dismount the Recovery Storage Group DB).
Step 4 – Get the Data back to a PST using EXMERGE
After the MSExchangeSA has restarted (you might have to Mount the RSG Store again) open up EXMERGE and run through the process as detailed previously in this article – but when you get to the list of mailboxes in the RSG you will see that our mailbox is now there! (see below):

Select it using EXMERGE and perform a normal export to PST file.
When the export process from EXMERGE is completed we need to configure the “Andy.Grogan” account in AD.
We need to do this because as we changed the msEXCHMailboxGUID it disconnected the account from the mailbox in the store.
Open ADUC (Active Directory Users and Computers) and find the account that you are working with (or the “Andy.Grogan” account in the examples that we have been using) right click on it, select “Exchange Tasks” and then choose the “Remove Exchange Attributes” option (see below for an Example):

When we have done this we will need to recreate the users mailbox – to do this right click on the account and choose “Exchange Tasks” and then choose the “Create Mailbox” option then go through the process of establishing the users mailbox.
When you have done this, open EXMERGE again running through the “Extract or Import” – only this time ensure that you choose “Import data into an Exchange Mailbox” – run through the Wizard for importing the PST into the account that we created earlier – and voila! – data restored.

Andy that is awesome, great write up. I really enjoyed this little project HONEST!! You are a true gent and I feel many others will benefit from the above topic.
With Gratitude,
Phil.
By: Philip on August 9, 2007
at 8:09 pm
Andy – you are brilliant and tenacious! Nicely sleuthed and explained! You are a valuable asset to the Exchange community. Keep up the great work.
By: Dean T. Uemura on August 10, 2007
at 3:07 pm
Thanks Dean, I appreciate that, it was great fun working through it and with Phil.
By: Andy Grogan on August 10, 2007
at 5:06 pm
[...] Using Recovery Storage Groups where the primary mailbox has been purged from the store… [...]
By: Weekend reading - subject: exchange on August 10, 2007
at 6:22 pm
[...] stuff that I come up with for this blog has at some point gone through my home lab (examples are: Recover Storage Groups, Disabling IMAP to name a [...]
By: Test labs - a nice toy, or an essential part of an enterprise… « telnet 127.0.0.1 25 on August 13, 2007
at 6:56 pm
Andy,
Great article – this helped a great deal with a recovery project I started this week.
I wanted to point out one thing that was not clear to me. When you take the GUID from the EXMERGE.LOG, you stated that some of the characters could be grouped with as many as 4 characters. The GUID I was working with had a grouping of 5. I discovered that a space must be placed between each character after the HEX or the first 2 digits are separated…clear as mud? Example:
\E3j0G\ = E3 j 0 G
E3 j 0 G = E3 6a 30 47
Overall, very helpful! I’m a programmer at heart and was contemplating a conversion tool to take this mess and turn it into a readable HEX string for ADSI. Then I thought … surely MS has a tool already available, after all, the system has to convert this string in the first place!!
By: Brandon on August 23, 2007
at 2:41 pm
Great article. Saved me a ton of time. Thanks so much!!!!
By: Christian on August 25, 2007
at 1:23 am
Hi Andy,
Good one… i like this please keep on posting based on your research.
By: Ismail on August 28, 2007
at 5:39 am
Hi Andy,
Great Job Done.
By: Satyajeet Sharma on September 14, 2007
at 2:32 am
I’m running Exchange 2003 SP2, and I didn’t have to restart my Exchange services like it says at the end of step 3. Of course, I’m only exporting the data to a PST, not to the mailbox object.
By: Eric Henson on September 25, 2007
at 10:49 pm
Great article really useful thanks!
One question though -
I get iI (lower case and capital i) in my exmerge.log this is not hex so am i done for re the guid?
If you can help you are a pure star!
By: Firestarr on October 12, 2007
at 1:14 pm
Just another shout-out to say Thank you! The very intuitive solution worked like a charm– why MS does not publish this is beyond me.
By: dcc1234 on October 23, 2007
at 4:52 pm
I still struggle with the convertion. May you please check if I got it right?
CC\F4\DA\C2wucG\81\264y\C7\BDq\E9
to
CC F4 DA C2wucG 81 26 04y C7 BDq E9
to
CC F4 DA C2 w u c G 81 26 04 y C7 B D q E9
finally to
CC F4 DA C2 77 75 63 47 81 26 04 79 C7 BD 71 E9
Thanks in advance!
By: Klaus on October 31, 2007
at 2:44 pm
Andy answered me quickly, thanks a lot!!
Hiya Chap, have a look at the following;
CC\F4\DA\C2wucG\81\264y\C7\BDq\E9
To
CC F4 DA C2 w u c G 81 26 4 y C7 BD q E9
To
CC F4 DA C2 77 75 63 47 81 26 34 79 C7 BD 71 E9
Cheers
A
By: Klaus on October 31, 2007
at 5:39 pm
Thank you very much.
You saved me !!!!
By: Luis on November 22, 2007
at 5:00 pm
Andy, if you are ever in Switzerland. just send me an mail. You Save my Live and i Own you a lot of beer
Regards Konrad
By: Konrad on December 16, 2007
at 1:45 pm
I need to convert \BC\B5\E53\19L\FF\40\BC\EA4\F3\5Dkf\A4 to HEX
I have:
BC B5 E5 33 19 4C FF 40 BC EA 4 F3 5D 6B 66 A4
Is this correct?
By: RedCellNL on January 9, 2008
at 10:09 am
I hadn’t thought of going after my recovery this way.
However, I’m on Exchange 2007, and using the database recovery tools to locate the GUID’s of the current user in AD, they don’t look anything like the GUID in ADSIEDIT.
GUID from recovery tools: 1f7826f8-ad11-4033-a3ad-f627eb46d715
GUID from ADSI Edit (in hex): F8 26 78 1F 11 AD 33 40 A3 AD F6 27 EB 46 D7 15
There’s more than just a conversion going on here, don’t you think?
By: Greg on January 15, 2008
at 4:34 pm
One more Thanks. This worked perfectly, and I had 2 consultants telling me I had to create another server with the same name, yadda yadda yadda.
Not only was your solution extremely effective, but your write up was simple enough for those of us who do not spend their day in the bowels of Exchange to understand.
I will follow Konrad’s lead, and say that if you are ever in Chicago, beers on me.
Walt
By: Walt on February 1, 2008
at 3:03 pm
worked like a charm. Thank you very much.
Just like another comment, when doing a conversion, if more then two digits, separate each digit after it the first two.
By: Vitaly on April 9, 2008
at 3:05 pm
To Greg (January), and in case others wonder about the {xxxxxx-xxxx-xxxx… style GUID conversion to Byte array (hex values):
The GUID consists of {long int-short int-short int-2*byte-6*byte}. So the 4 first bytes are in reversed order (as they are a 4-byte long int value), the two next pairs are also in reverse order (short ints) and the last pair as well as the rest of the bytes are in “normal” order from the byte array…
By: Jorn on June 2, 2008
at 5:51 am
Simple, effective and devastatingly useful to know when dealing with deleted users / mailboxes.
Can’t thank you enough!
By: ViewAskew on June 6, 2008
at 10:55 am
Excellent Post buddy. Really worked out for me nicely.
Thanks a lot.
By: Pradeep on July 11, 2008
at 3:23 pm
Andy, it’s all been said really – brilliant post. At first look I thought OMG this will be a nightmare! But not at all, followed your instructions and worked perfectly and didn’t take long either. Superb stuff.
By: Chris S on July 30, 2008
at 11:56 am
You champion! Thanks so much, very useful
By: David B on August 25, 2008
at 6:29 am
Excellent post… you are a legend.
By: Bevan S on September 3, 2008
at 11:24 am
I get an error message when applying the new GUID in ASDI Edit that the format is incorrect, though it appears to be correct. Here are the steps:
wG\E7D\8Fq\87O\81\B6\28\5FM4P\E9
wG E7D 8Fq 87O 81 B6 28 5FM4P E9
wG E7 D 8F q 87 O 81 B6 28 5F M 4 P E9
wG E7 44 8F 71 87 4f 81 B6 28 5F 4d 34 50 E9
The article did not address a 5 character group. Is the method I used correct? why would I get a format error?
By: Ed Adams on September 24, 2008
at 3:45 pm
I figured it out. My clue should have been that “w” is not a hex character. If there is no slash “\” in front of the first group, they are ASCII characters, not hex, so each character must be individually converted to hex.
Also, I could not import the pst back into Exchange – which did not matter for my purposes.
By: Ed Adams on September 24, 2008
at 6:51 pm
Great article! This saved me hours of time building another server. Just wanted to mention that the new mailbox you create does not have to match the name of the old mailbox you deleted. This really helped me since we had already created the new user and that user was using their mailbox, but we needed to restore the mailbox from a month ago. I just created a dummy user called Recovery Mailbox, and edited that account to match the GUID. Exmerge picked it up and exported it under that name no problem.
By: Luke on October 6, 2008
at 9:59 pm
Stunningly useful article. Thank you for making this info available. God’s got a special desk reserved for you in heaven’s data center.
By: dcj2 on October 9, 2008
at 7:40 pm
Hi Andy,
I have to say this is a great article in an attempt to recover a mail database via the BKF backup. I also want to note a few items in reference of your article:
*I was trying to recover data from the RSG (after a successful restore of the BKF backup) but neither the main DB nor the RSG DB would mount. What I did was restore the BKF backup onto the main DB in ESM, and fortunately, it mounted after the restore.
*As it was not the same with your tutorial regarding the GUID for the RSG DB, I had to log in my production DC to obtain the msExchangeGUID and copied it to my test lab DC’s user profile (the same profile that I was trying to extract emails from).
*After copying the GUID to my test DC’s use profile, EXMERGE was beginning to extract data from the so-called “PURGE” mailbox (although right now there hasn’t been any indications if it’s successful or not). Will keep my fingers crossed…
Thanks again for the article…it’s certainly helpful and guided me to my own discovery.
Christian
By: Christian Dinh on October 21, 2008
at 4:11 pm
Thank you, Thank you!!! Easy read for a very technical procedure – and it worked! Mine was a bit different circumstances – moved account from 2003 to 2007 environment – user did not notify about missing inbox items until back stopped in the 03 environment – so resorted to monthly RSG. By then mailboxGuid has changed but the account was still active in AD – so it was a long shot but all i need was alias name and the right GUID – and it worked!
By: Ermias on December 29, 2008
at 5:11 pm
Really useful and well written, thanks for taking the time on this one.
By: Neil on January 30, 2009
at 10:46 am
Thank you for this article, this works extreamly well only thing I had take care is about the legacyexchange attribute.
By: Vinayaka on February 10, 2009
at 6:11 am
Guys thx for this post, but i still d’ont get the way to covert the GUID. Is there anybody that create a tools to auto convert ?
I need to convert
1 User : \D8\D4\C2\3B\EC\60\BDA\B90\BAc\1F\C4\F5\84.
2 User :
\B7\84\9F\C2\FA\5BYI\85\9B\BA\7B\5B\7C\F4.
By: brular01 on February 16, 2009
at 3:33 am
Hi,
I’m having a problem with the ASCII conversion. The document mention 2,3 & 4 digit codes, i have a guid with a 5 digit section, how should this be seperated?
E2 FCE39 29 ADD A8 E1 CC F4 8A CA B4 07
Thanks in advance, Richard.
By: Richard Swan on March 2, 2009
at 11:55 am
Great Work. I knew there had to be a better solution then Microsoft recommended.
By: Tom on March 6, 2009
at 4:07 pm
Hi Great article here except out of about 10 guids to convert to hex there are 4 that I still cannot convert I have thought and tried everything, please please someone help. Here is the list:
1.
\F53\3D\CCB\DA\F8J\B2\ED6\7F\C8\E5\F2\E2
F5 3 3D CC 0B DA F8 J B2 ED 06 7F C8 E5 F2 E2
F5 33 44 CC 0B DA F8 4a B2 ED 06 7F C8 E5 F2 E2
2.
\EF\84\E3\BEU\1E\C8N\94Z\21\9AB\B9\27\85
EF 84 E3 BE U 1E C8 N 94 Z 21 9A 0B B9 27 85
EF 84 E3 BE 55 1E C8 4e 94 5a 21 9A 0B B9 27 85
3.
\18\F5\12D\22pyD\9B\5B\EA\8AZ\CC47
18 F5 12 D 22 p y D 9B 5B EA 8A Z CC 4 07
18 F5 12 44 22 70 79 44 9B 5B EA 8A 5a CC 34 07
4.
\12\2B\FE\3D\40\F76B\8C\D5\10s\F0E\21\F8
12 2B FE 3D 40 F7 6B 8C D5 10 s F0 E 21 F8
12 2B FE 3D 40 F7 6B 8C D5 10 73 F0 45 21 F8 (which doesn’t give me enough values)
When I say I can’t get these working I mean exmerge won’t work nor will merging the mail from the RSG. As I say the other 6 I did worked fine. Thanks anyone for your assistance?
By: Bruce Mcdonald on March 17, 2009
at 4:26 pm
Bruce,
For your point 1, it should be like this….
F53 3D CCB DA F8J B2 ED6 7F C8 E5 F2 E2
F5 3 3D CC B DA F8 J B2 ED 6 7F C8 E5 F2 E2
F5 33 3D CC 42 DA F8 4A B2 ED 36 7F C8 E5 F2 E2
Good Luck!
Sugih
By: sugih on April 2, 2009
at 5:34 am
Hi Andy,
I have been using your post as a reference for a while. However, I noticed that all images are gone. Do you have any idea what happened to the images?
Regards,
Ilker
By: Ilker Aydin on June 26, 2009
at 4:21 pm
Thank you, thank you, thank you. The only results I could find on this was the the SAME post, cross posted 100 times, with a self reply saying “I found the answer…” without sharing the solution.
Maddening.
Thank you SO much for this.
By: Charley Socci on July 8, 2009
at 11:23 pm
Its maddening that you needed to research this – this info *should* be on Microsofts website, no?
Thanks very much!
One note that took me a few mins to figure out that wasn’t self evident (to me) to do with 4 character groupings – only the first two characters are hex, the third and fourth (xx) need converting as single characters, to obtain 16x character pairs.
Well done,
Ian
By: IanT on July 13, 2009
at 9:59 pm
On 2003 SP2, it’s correct that you don’t have to restart the SA service ..however, in Exmerge the mailbox, when it DOES show up, shows as having the data size of the CURRENT newly created users mailbox.
I was still able to export it properly to .pst as it did pull from the correct recovery group and had the correct size.
Absolutely amazing post! Can sleep at night now without worrying about pulling data from deleted accounts.
Can’t thank you enough!
By: OfficeJedi on August 6, 2009
at 3:36 pm
Andy, here is my text
\DC\D3\82\9EK\7E\1DE\ADw0M4\BA\B03
I have tried this conversion
DC D3 82 9E 4B 7E 1D 45 AD 77 00 4D 04 BA B0 03
and this one
DC D3 82 9E 4B 7E 1D 45 AD 77 00 4D 34 BA B0 33
but the mail box will not populate in exmerge. I also do not see any change in the msEXCHMailboxGUID when I go back into the properties window. any help would be appreciated.
Warren
By: Warren on August 20, 2009
at 3:44 pm
ADw0M4
corrected
don’t know why that pasted incorectly.
By: Warren on August 20, 2009
at 3:51 pm
looks like the post changes after I submit. the above is still incorrect.
By: Warren on August 20, 2009
at 3:54 pm
I muddled through the equivalent of this in Exchange 2007 and wanted to get this onto the Internet before I forget. The GUID of the mailbox in the RSG will appear in the Database Recovery Management tool in the list of matched mailboxes. To convert this to hex for ADSI Edit, you reverse the order of PAIRS of characters in the first three groups, but leave the last two groups verbatim. E.g., the GUID I needed to set for my user was {FEFCB942-CC72-47A3-AC08-8CE1AD6E5BE1} and so the hex I entered into ADSI Edit was 42 B9 FC FE 72 CC A3 47 AC 08 8C E1 AD 6E 5B E1. The spaces are important when you are typing the hex in ADSI Edit. Hope I saved someone else a few hours and some hair.
By: Steve on September 23, 2009
at 9:39 pm
To convert COM type GUIDs (as used in EMS output) to Octet streams you can use in ADSIedit use this GUID Converter Tool : http://directoryprogramming.net/files/3/freetools/entry2.aspx
It also converts to (and from!) other types (ie LDAP filter and Base64).
By: George on October 15, 2009
at 8:32 am