Powershell to delete email items over 10000 results.

Hello,

Can someone help me with a PowerShell command I am struggling with?  From a single mailbox, I will to delete emails older then 30 days via Powershell but the results are over 10000.  I can't seem to get the right use of New-MailboxSearch to work correctly.  Could someone provide the command for me please?

Shawn

June 5th, 2015 8:22am

Hi there,

I think this article fits your problem scenario: 

https://www.petri.com/delete-email-from-microsoft-exchange-user-mailboxes-using-powershell

Free Windows Admin Tool Kit Click here and download it now
June 5th, 2015 8:41am

Nope.  This uses the Search-Mailbox command which has the 10000 limit.  This is the thing I need to get over.  I would rather not have to run the command many times over.

Thanks!

Shawn

June 5th, 2015 8:51am

Hi Shawn,

As you know, the -searchquery parameter will only pull 10,000 results,

If you want to delete email items over 10,000, you will have to run the command many times.

Base on my knowledge, it is the only way to delete over 10,000 items.

Best regards,

Free Windows Admin Tool Kit Click here and download it now
June 8th, 2015 2:27am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics