Hi,
I've got an issue with using Export-Mailbox cmdlet in Powershell to delete emails between two dates from a mailbox. The current code that I am running is:
Export-Mailbox -Identity mailboxname -StartDate "01/11/2009 00:00:01" -EndDate "14/11/2009 00:00:01" -DeleteContent
I know there are emails that fall between these two dates, but every time the command runs and completes but gives a status message of "Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error: An unknown error has occured."
Has any had success with using Export-Mailbox to delete messages, or know why this is erroring out?
Thanks.
- Jonny
~~~ SOLUTION ~~~
Using the help from David I ran the command again as follows:
Get-Mailbox -Identity jonny | Export-Mailbox -TargetMailbox target -TargetFolder folder -EndDate "14/11/09 00:01:00" -StartDate "14/11/09 00:00:00" -DeleteContent
This worked as long as there weren't any more than 3000 emails in that timespan.