export-mailbox creates HUGE pst file
Hi there,
I have a problem with the export-mailbox command. First some background:
We have our user databases journal to a single mailbox. This mailbox grows at a stupidly fast rate and eats through disk space like you wouldn't believe. To mitigate this I decided to use export-mailbox to archive out older journalled mail to pst as it is
rarely needed. This worked very well and using a script (see below) I was able to leave this running to bulk export to a pst-per-day for the backlog that had built up. When I ran this 3 months ago the pst files created were approximately 400-500Mb for each
week day and 30Mb for weekend days.
For various reasons I stopped doing the export for a period of about 3 months, and now that I have returned to it using the same script I get pst files of 5 or 6Gb. If I open the over-sized pst in Outlook and go to properties | advanced I can compact the
file back down to around 400-500Mb, so I know the file created has unnecessary white-space in it. This is the point I need help with. The daily mail volume has not increased significantly - certainly not by a factor of 10 - and the script is the same
one used previously. No additional updates have been applied to Exchange in the intervening 3 months, although they have been applied to the operating system.
The script I'm using is as follows:
-------------------------->8------------------------
foreach ($user in (Import-CSV "c:\pst\exportLCMLONJournal.csv")) { Export-Mailbox "LON2011Journal" -IncludeFolders '\Inbox' -StartDate "$($user.StartDate)" -EndDate "$($user.EndDate)" -PSTFolderPath "c:\PST\LONJournal\$($user.Filename)" -Confirm:$false }
-------------------------->8------------------------
The CSV refered to has the following content with no trailing spaces on the lines or at the end of the file:
-------------------------->8------------------------
StartDate,EndDate,Filename
24/03/2011,24/03/2011,LCMLONJournal_24Mar2011.pst
-------------------------->8------------------------
When used before the csv file had over a full year of lines - something like 400 lines.
Server setup is:
- Windows 2008 Enterprise SP2, Exchange 2007 8.1 build 240.6 in 2 node CMS cluster for mailboxes, 8.2 build 176.2 for transport/CAS roles, Powershell 2.0 + current updates
Client used for export is:
- Windows XP (32-bit) SP3, Exchange 2007 32-bit client tools, Powershell 2.0 + current updates, Outlook 2003 SP3
I think I've included anything relevant, but please ask if I've missed anything. This has been driving me nuts - it makes no sense to me that the same script that worked 3 months ago and created sensible sized files now creates massive over-bloated files.
Thanks in advance,
James Dane
July 6th, 2011 6:42am
Hi James,
Per your description, do you meat that the pst file which is exported per day seems huge (5/6G), but, actually it is just 400-500M if we check it through outlook?
I would suggest that you could use the pst scan tool to repair the pst file, and check the result.
How about to change the script without using the csv and foreach, just for one day, and manually run it through EMS, what is the result?
Regards!
Gavin
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your
question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 6:45am
No, the PST file created is actually 5 or 6 Gb, but when you open it in Outlook and use the Compact function it reduces to the expected size of around 500Mb. Scanpst actually corrupted the PST the first time I tried using it, so I've avoided that since...
I've tried stripping this back to run the command in the EMS already - same result; I end up with a 5Gb+ PST file that has 90% whitespace and compacts to around 500Mb.
Additionally, overnight I built a clean workstation (I've been using the same one from 3 months ago) and on the clean build with the same script I get the same result - massive PST with whitespace.
July 7th, 2011 7:23am
I bit the bullet on one of the two workstations and installed Exchange 2007 32-bit SP3 and Rollup 3 v2. - still have the same problem, unfortunately.
One of the symptoms is that during the export the 'Moving Messages' item count goes way higher than the number of messages actually exported. For example, for one particular day I know the item count is around 4800, but on export the Moving Messages
line reads (7532/292142) with the 7K number rising. 292142 is the total items in the mailbox.
Why would this count be rising past the number of messages that it should be exporting?
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 8:15am
Hi James,
Per your description, do you mean that the pst file which is exported per day seems huge (5/6G), but, actually it is just 400-500M if we check it through outlook?
I would suggest that you could use the pst scan tool to repair the pst file, and check the result.
How about to change the script without using the csv and foreach, just for one day, and manually run it through EMS, what is the result?
Regards!
Gavin
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your
question. This can be beneficial to other community members reading the thread.
July 7th, 2011 1:42pm
Hi James,
Could you please use below script to export one day emails:
Export-Mailbox -identity "LON2011Journal" -IncludeFolders '\Inbox' -StartDate xxx -EndDate xxx -PSTFolderPath "c:\PST\LONJournal\xxx.pst" -Confirm:$false
How about to use the get-mailboxstatistics of the journal mailbox, confirm the mailbox size?
How about to check the email items size per day through owa or outlook, although it is tough, but we could narrow down the issue.
Did you delete the contents from the journal mailbox after you export the items to the pst file?
Regards!
Gavin
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if
a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 11:31pm