Thursday, June 25, 2015

Exporting Email from Exchange 2010 to PST – About everything that could go wrong

So a client had an old SBS 2011 server that was out of service with Exchange 2010 on it. They have been running Office 365 for about 9 months and did a clean cutover no migration, since most of the data was, as they put it “old junk”. However they wanted a copy of that “old junk” before that server is taken to the recycle center just in case. Which is always a good idea and sounds simple enough. Since it is exchange 2010 you don’t have to use exmerge or some other older tool you can use powershell commands that export each mailbox to its own big .PST to a drive share that will be copied to a copy external hard drives or tapes and put on a shelf and be forgotten about till some needs a drive or tape.

So I start out trying to run the basic command to give myself permissions:

New-Managementroleassignment –Role “Mailbox Import Export” –User “Administrator”

Command does not exist… (Quick Research and I need to add Exchange Service Pack 1)

Install SP1 and run the command above again and it completes but then the sub commands fail.

$Export = Get-Mailbox

Note: Once you run the first permissions command above you may have to close and reopen Powershell or even log off and on of the system.

I create a Shared folder for the PST exports and ran the following with my share path:

$Export|%{$_|New-MailboxExportRequest -FilePath "file:\\servername\pst\$($_.alias).pst"}

then I receive unable to access path?

So I try every possible path. And went back to basics and browsed to the path. Sure enough I could see the folder in explorer but when I clicked on it would fail with path not found!? So I double check permissions on the share and then browse to another old share and the same error. At this point I realize there is probably a name resolution issue. From a quick ping I saw it was still searching for the old IP. I quickly found there was a host file using the old IP so I removed that. I was then able to Ping correctly and browse to the shares.

I would try this or that but it was just an endless trail of errors for what should be a simple three or 4 lines of PS and done. The errors included:

Remote Permanent Exception ‘Fully Qualified Error, Transient Service Error, Unable to access Mailbox.

Attempted fixes included: Confirmed mailboxes were not disabled, Enable Exchange Replication Services, Add Exchange Trusted Subsystem group to share

I knew all my permissions and settings were correct. So we determined it had to still be name resolution so we went deeper into SBS. Since it was a DC it still had references to the old static IP from a different NIC. Now it is using DHCP. So I set the IP as static to what it was now receiving from the DHCP server and excluded it on the scope for now till this project is done. I then added DNS entries for its new IP address in it’s local DNS, confirmed the network bindings were in order since it is using a different NIC. Flushed the local DNS cache and ran clean nslookups. We then restarted the server. Logged back on and then everything worked as it should have from the beginning. Here are the commands in order and steps if your environment is clean and running Exchange SP1:

· Create a network share for the PST files and share with admin performing this process and Exchange Trusted Subsystem.
· New-Managementroleassignment –Role “Mailbox Import Export” –User “Administrator”
· $Export = Get-Mailbox
· $Export|%{$_|New-MailboxExportRequest -FilePath "file:\\servername\pst\$($_.alias).pst"}

No comments:

Post a Comment