Search-Mailbox and overcoming 10.000 item limit.

So You have a mailbox that is filled with spam, phishing or whatever emails that You dont want.

I have to say that Microsoft’s new command (new-compliancesearchaction) seems nice, but doesnt work.

new-compliancesearch and then start-compliancesearch find messages, but thats all. Even these commands would delete emails, there’s a limit for 10 msg per search.

Vanhassa vara parempi (Finnish saying, translates that old is better)

Above loops search-mailbox cmdlet with the limitation of 10 000 email, but loops it when its done.

These new-pssessionoption with timeout 0 which is kinda self-explaining.

Cheers,

Author: Harri Jaakkonen

Leave a Reply

Your email address will not be published. Required fields are marked *