Aug 10, 2009

How To Do Brick Level Backups on Exchange 2007

At my company we recently setup our first Exchange 2007 server and are in the process if migrating our 2003 users over to it. Before doing that though we needed a good way to do brick level backups.

In Exchange 2003 that is really easy. In fact, I wrote an article about how to script that using Exmerge a little while ago. You can check that post out here: (Brick Level Backup Using Exmerge)

For 2007, it isn’t quite so straight forward. In fact, I saw many articles saying how to do it, but when I actually tried it, their method didn’t work. Maybe it would if you only had one mailbox store, but at my company we have several. Here is the commands I use:

get-mailboxdatabase "servername\*" | get-mailbox | Export-Mailbox -PSTFolderPath \\fileserver\backup$ -MaxThreads 10 -Confirm:$false

NOTE: The above command is all on one line.

brick backup exchange 2007 As you can see in the first section, I used “servername\*”, that wild card allowed me to pipe all of the mail stores into the next segment which listed all of the mailboxes on all of the stores which piped it into the next segment that actually exports the contents to PST. I used the maxthreads switch to increase the number of mailboxes that can be exported at a time as the default is 4. Finally the confirm:$false switch lets the script run without a prompt. That is important for scheduling the task.

Which brings me to the next point which is how to schedule that task. Once again, I did a Google search for it, and the answers I found were not accurate. In order to make my command run correctly, I had to take my command above and paste it into a text file where I named it BRICK.ps1. Next I had to create a batch file called BRICK.cmd. In that I pasted the following:

powershell -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'C:\BRICK.ps1'"

NOTE: The above command is all on one line.

After that, schedule the BRICK.cmd file to run as you normally would.

Please note that the first time I tried running this script I would get the following error on most of the users mailboxes:

MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000, error code: –1056749164

I got that because for some reason the backup administrator account was not given full mailbox access to all of the mailboxes when Exchange 2007 server was first setup. To give global full mailbox access I had to run the following from the Exchange Management Shell:

Get-Mailboxdatabase | Add-AdPermission -User “username” -AccessRights GenericAll

NOTE: The above command is all on one line.

Now we are getting full Brick level backups to PST similar to the way we were doing it in Exchange 2003. Has your company moved to Exchange 2007 yet? What do you use for backups? Have any questions? Let us know in the comments.

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | stopping spam