question

KurtStichelmans-9145 avatar image
0 Votes"
KurtStichelmans-9145 asked KurtStichelmans-9145 commented

export via powershell does not move items

I have an Exchange 2016 cu latest.
I want to export some mail items from the sent items to another folder in that same mailbox.

so this is what I do:
powershell
New-MailboxExportRequest -ContentFilter {(Sent -lt '01/01/2019') -and (Sent -gt '01/01/2015')} -includefolder "#sentitems#"-Mailbox "test" -FilePath \\srvname\me$\test-archive.pst

New-MailboxImportRequest -Mailbox "test@test.com" -FilePath \\srvname\me$\test-archive.pst -TargetRootFolder "sent items/mailarchive"

That works and I see the mail items in that created folder.
But those items are still in the sent items folder.
They are copied, not moved.

How can I become that an export is a move an d no copy?

Thanks for your knowledge.

Best regards
Kurt

office-exchange-server-administration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AndyDavid avatar image
1 Vote"
AndyDavid answered KurtStichelmans-9145 commented

Use Search-Mailbox and delete the content. There is no switch to delete the source content using that command
https://docs.microsoft.com/en-us/powershell/module/exchange/search-mailbox?view=exchange-ps

113289-image.png



image.png (50.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Andy David. Can use that info.
Have a nice day.
Kurt

0 Votes 0 ·