none
Restore-mailbox, how to restore to "top level" RRS feed

  • Question

  • Hi all,

    A client of mine was moving from Exchange 2007 to 2013 - and somehow (I'm not quite sure how) managed to screw the exchange 2013 database beyond repair.

    The decision was made to recovery the Exchange 2007 database to an RSG - and recovery the mailboxes for the 30-odd users that had been moved.

    The database restore into the 2007 RSG fine, we then had to remove the (exchange 2013) mail attributes for the 30-odd users and create them a new mailbox on 2007, in which to restore their mail.

    So, I have two questions....

    Question 1 - why on earth does the restore still not happen when the guid's match ?

    Restore-mailbox -identity (alias) -RSGDatabase (RSGDatabase) - will not restore as the guids don't match - which is fair enough.... but after

    extracting the original guid for the RSGDatabase (using get-mailboxstatistics)

    then converting it

    $guid = [System.Guid]"d5a59c02-e749-4626-9820-674adc51650f"
    $Bytes = $guid.ToByteArray()
    Write-Host $Bytes

    and plugging it in via ADSIedit

    Its still not seen as a match - even though the guids are now identical!!

    Question 2 - How on earth can you restore to an alternate mailbox and not have to create subfolders ?

    Given the situation above, the logical solution is to restore to an alternate mailbox... however I am required to enter the -targetfolder parameter, otherwise the command wont run.

    I've tried entering various things such as "\" and "*" along with null etc (which isn't accepted)...

    if I enter "*" I get a subfolder in the users mailbox for "* \ Top level information store \ <mailbox contents>

    Is it possible to get around this supremely annoying requirement ?

    And yes, im working xmas day - that's how I roll!

    Friday, December 25, 2015 1:37 AM

Answers

  • I said there are better tools for it - but for only 30 mailboxes, it wouldn't be worth your while putting together what you'd need to use.  It'd be easier to just restore into a subfolder, then manually move the data from there to the required folders.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    • Marked as answer by Ben_22 Friday, January 1, 2016 11:24 PM
    Wednesday, December 30, 2015 1:27 PM

All replies

  • Answer 1:  The GUID isn't the only key that system uses to map the mailbox in Exchange 2007.  If you can undelete the original account (which isn't possible if you have a Windows 2003 domain), you would be able to get the mailbox recovered to the account properly, but otherwise, I'm afraid you would have to "rebuild" the original account if you wish to recover the way you hope to.

    Answer 2:  Again, I'm afraid that if you don't have the original account, you can't recover the mailbox to the root of the new mailbox.  Recover-Mailbox to a new account in Exchange 2007 doesn't work the way that a New-MailboxRestooreRequest does in Exchange 2010, or even the way it does with the original mailbox in Exchange 2007.  It copies the data to the folder you specify, and I don't believe you can recover to the root.

    I will add that once the data is restored, you can mode the mailbox to Exchange 2013 and use other (more updated) tools to move the data into the folders so they are off the root.


    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Sunday, December 27, 2015 11:59 AM
  • ok, thanks for that Will.

    In this instance

    1) the original account isn't deleted - it simply believes its mailbox is on a database which is no longer available. Due to this, exchange attributes have been removed from AD pointing to the "dead" 2013 database and a "new" mailbox created on the old 2007 server. I would be really keen to know what other attributes apart from the guid determine whether restore-mailbox will recognise the mailbox as the same mailbox.

    2) I do have the original account - as above. Fair enough that 2007 cannot restore to the root. The data can be restored to a sub-folder then moved to 2013.... what commands can I use to move items in 2013 to the top level ?

    thanks

    Monday, December 28, 2015 5:23 AM
  • For #1, you say you have the original account - if so, you need to remove the Exchange attributes from it before you can recover the mailbox for it.  If it's got a mailbox, it's going to recover into a folder in the mailbox, not to its root.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Monday, December 28, 2015 1:08 PM
  • Hey will...

                    yep, if I remove the exchange attributes, then try restore-mailbox -identity <userid> -RSGDatabase <rsgdatabase>

    I get "the specified user cannot be found", even though a user with the specified SamAccountName exists.

    I also tried swapping out the mailboxalias/userid for the GUID from the RSG, same error.

    If I use the GUI Exchange troubleshooting assistant - the error is slightly different...

    Error restoring the mailbox (/O=<company>/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=<userid>). Error message is: The specified user "/O=<company>/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=<userid>" could not be found..

    This is why I thought a "blank" mailbox has to exist to restore into - which is what resulted in the original post.

    I realise this is probably simple stuff for someone with your position - so apologies for the back and forth - but im struggling with it.

    Monday, December 28, 2015 10:37 PM
  • Don't worry about it being simple or not - I'm sure if I was at the keyboard, I'd have to search for the solution before I found it, as well (it's been a while since I had to recover a mailbox in Exchange 2007 - it's so much easier in Exchange 2010 and later).  You mentioned that you changed the GUID for the account - did you also attempt to change the legacyExchangeDN for the account?  This last error is looking specifically to match that property.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Tuesday, December 29, 2015 1:29 PM
  • Hey Will,

                    No, didn't change that.

    So initially, on one mailbox, I removed the mailbox attributes, created a new mailbox (back on 2007), then updated the exchangeGUID to match the guid from the recovery database - no dice. I then also tried updating the legacy DN, no dice.

    In this case though, where I tried restore-mailbox without the user having any mailbox attributes, they do not have a legacyDN set at all.

    These tests are all being run on completely separate accounts - so previous things I have tried should not be affecting new changes.


    • Edited by Ben_22 Tuesday, December 29, 2015 7:39 PM
    Tuesday, December 29, 2015 7:35 PM
  • Try setting the legacyExchangeDN to the setting your error returned, in this last case, "/O=<company>/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=<userid>".  You should be able to do this in ADSIEdit, the same way you changed the GUID before.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Tuesday, December 29, 2015 8:10 PM
  • Hey will,

     yep, I had tried that one, with no success - same error.

    I noticed in ADSIedit that the value msExchWhenMailboxCreated still exists, which was interesting given that the AD account should no longer have any mailbox attributes associated.

    I think its time to move on from this - as people have started coming back, so had to go through and restore to a subfolder in a new mailbox - which isn't good - but its also only approx. 30 people, so its not a disaster.

    In an earlier post, you mentioned that if the mailbox is on 2013 (which we can make happen) - there is an easy way to move the mail etc from the restore folder back to the top level... I haven't been able to find this - are you able to expand on that comment ?

    Wednesday, December 30, 2015 3:54 AM
  • I said there are better tools for it - but for only 30 mailboxes, it wouldn't be worth your while putting together what you'd need to use.  It'd be easier to just restore into a subfolder, then manually move the data from there to the required folders.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    • Marked as answer by Ben_22 Friday, January 1, 2016 11:24 PM
    Wednesday, December 30, 2015 1:27 PM
  • yep, ok fair enough.

    Thanks for your help Will....

    Friday, January 1, 2016 11:24 PM