export via powershell does not move items

Kurt Stichelmans 561 Reputation points
2021-07-09T15:09:09.597+00:00

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

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,637 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andy David - MVP 148.2K Reputation points MVP
    2021-07-09T15:14:14.503+00:00

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

    113289-image.png

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.