We help IT Professionals succeed at work.

Export-Mailbox - will not delete the dumpster

jacass
jacass asked
on
2,147 Views
Last Modified: 2012-05-08
I am running the following script

Export-Mailbox -Identity administrator -PSTFolderPath z:\administrator.pst -deleteassociatedmessages -DeleteContent

This works and the .pst file is created with all the files out of the dumpster as expected.

The report at the end of the export says :

StandardmessagesDeleted  :  123
AssociatedMessagesDeleted  :  11
DumpsterMessagesDeleted  :  117656

The messages from the inbox are deleted as shown in the report but if I run the script again the dumpster files are still there, the report above is the 3rd time I have run the script and with 117,656 messages it takes forever.

Any one know why?
Comment
Watch Question

Satya PathakDomain Architect
CERTIFIED EXPERT

Commented:
it does not remove those messages because they are within the recovery bin
Solutions Architect, Project Lead
CERTIFIED EXPERT
Top Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Manpreet SIngh KhatraSolutions Architect, Project Lead
CERTIFIED EXPERT
Top Expert 2013

Commented:
Check what this Article says:

http://technet.microsoft.com/en-us/library/bb266964.aspx
What Data Is Exported
By default, the Export-Mailbox cmdlet exports all empty folders, special folders, and subfolders to the target location. To specify which folders to include in the export, use the IncludeFolders parameter. To specify which folders to exclude from the export, use the ExcludeFolders parameter.

By default, the following special folders are exported when you use the Export-Mailbox cmdlet:

Inbox
Deleted Items
Drafts
Junk E-Mail
Outbox
Sent Items
Journal
Calendar
Contacts
Notes
Tasks

The Export-Mailbox cmdlet exports all message types, including messages, calendar items, contacts, distribution lists, journal entries, tasks, notes, and documents. However, the Export-Mailbox cmdlet does not export rules.

The Export-Mailbox cmdlet also exports messages from the dumpster. Messages from the dumpster are converted to regular items in the folder or .pst file to which you export data.

Author

Commented:
OK, is there any way of not including the dumpster in the export?
Manpreet SIngh KhatraSolutions Architect, Project Lead
CERTIFIED EXPERT
Top Expert 2013

Commented:
Try using
Export-Mailbox -Identity administrator -PSTFolderPath z:\administrator.pst -DeleteContent

Author

Commented:
Hi Rancy,

Call me blind but what is the difference between yours and the one I used?

Export-Mailbox -Identity administrator -PSTFolderPath z:\administrator.pst -DeleteContent

Export-Mailbox -Identity administrator -PSTFolderPath z:\administrator.pst -deleteassociatedmessages -DeleteContent
Manpreet SIngh KhatraSolutions Architect, Project Lead
CERTIFIED EXPERT
Top Expert 2013

Commented:
I really dont know what this command used in between would do
"-deleteassociatedmessages"
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.