Forum Discussion

ADumith's avatar
ADumith
Iron Contributor
Feb 15, 2023

Search and delete emails content

Hello everyone,

 

I need to develop a script to maintain the mailboxes of my users when they are over quota.

 

I had found this:
Search-Mailbox myTarget -SearchQuery '(recieved<02/01/2003) AND (recieved>02/14/2023) AND (kind:email)'

 

But I understand that this command has been deprecated, so I was wondering if any of you could guide me on how to do the search (I still need to add another parameter) and eliminate the emails that meet this criteria.

 

Thank you in advance,

 

 

Resources