Powershell - Export-mailbox seems slow.
Has anyone found that running the Export-Mailbox routine in Powershell seems slow as compared to Exmerge?We are running in a mixed environment E2K7 and E2K3.My coworker and I have been experimenting with running an Export-mailbox routine as a task. We have used much of the information found here and other forums to get the script running, but have found that doing it this way seems very slow. Here are some of our observations.1) After a mailbox has supposedly completed it's export the time it takes to move to a new mailbox to export takes on the order 10-15 minutes, which seems long as compared to Exmerge. At this time the script simply looks for all users with the CustomAttribute15 populated then pipes that to the Export-Mailbox cmdlet. There are 24 mailboxes of various size ranging from 150MB to over 2GB.get-mailbox -resultsize unlimited |where-object {$_.CustomerAttribute15 -eq "EXMERGE"}| export-mailbox -PSTFolderPath c:\2) Using Exmerge to do these same exports takes about 1 hour max. We run multiple sessions. Can Powershell run multiple sessions? We are going to try this to see what happens, but figured I would ask here in case there are any known gotchas. Our current plan is to set CustomAttribute15 to something on the order of "XXXXX 1", "XXXXX 2", etc. and then have powershell scripts for each of the sessions running concurrently.Any thoughts or suggestions would be helpful.TIA. ncouch
January 14th, 2009 10:35pm

Hi Ncouch,1. Try with one user and see if it takes more time. You can also add -Verbos switch in export mailbox to check where it stuck because it gives time stamp for each and every steps.2. Did you try after adding -confirm:$false -maxthreads:XX switches in Export-Mailbox command to run multiple threads?Reference:Export-Mailboxhttp://technet.microsoft.com/en-us/library/aa998579.aspxAmit Tank | MVP - Exchange | MCITP:EMA MCSA:M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
January 15th, 2009 5:13pm

Amit,The MaxThreads definitely helped speed things up. Cut one job from almost 7 hours down to 3. One guy had a 2GB export so that dragged no matter what. It was still slower than ExMerge, but it was much faster than the previous version of the script.Thanks for the assist.Nate ncouch
January 16th, 2009 7:38pm

Were you running ExMerge from a separate workstation or server or were you running it directly on the Exchange Server? In the good old days, you could run ExMerge on the server. :-)I would not think that your directory query for customAttribute15 would slow anything down, either. Jim McBee - Blog - http://mostlyexchange.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
January 17th, 2009 4:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics