ReubA
ReubA

Reputation: 1

Office 365 bulk deleting emails using Powershell

I am in need of bulk deleting emails in one of our mailboxes that is full. I am wanting to bulk delete emails with a certain subject and also within a date range.

I know I can do something like this

Search-Mailbox -Identity "No Reply" -SearchQuery 'Subject:"Mail delivery system"' -DeleteContent

I am however unsure how to add in the date range.

Upvotes: 0

Views: 1645

Answers (1)

Wasif
Wasif

Reputation: 15470

You can use this:

search-mailbox -identity "No reply" -SearchQuery {received:mm/dd/yyyy..mm/dd/yyyy} -deletecontent

Upvotes: 1

Related Questions