How to remove old mail from public folders on exchange 2010 in powershell

Joost Kuin
Joost Kuin used Ask the Experts™
on
I need to remove messages from (sub)folders that reside below a public folder. The difficulty is that I need to be able to specify the maximum message age per individual subfolder.

public subfolder example
In the example (see screenshot) I need to remove the messages in the subfolders below "anno84".
Messages in the subfolder "Backoffice" should be removed after 50 days.
Messages in the subfolder "Callback" should be removed after 100 days.

I imagine that I'm looking for a powershell command/script that I would schedule daily to perform this task.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Solutions Architect
Top Expert 2016
Commented:
Tej Pratap Shukla ~DexterServer Administrator
Commented:
Hi,
For removing an Old email from Exchange server you have to run some command on PowerShell or Exchange Management Shell. But before going for deletion you have first assign the permission, then you have to assign the role to the user. Then you can search for a specific email and you can delete that email.
Go through this link: http://exchange-server-guide.blogspot.com/2016/08/delete-specific-email-exchange-2013-entire-organization.html
Joost KuinSenior system administrator

Author

Commented:
Hi guys,
Thanx for your suggestions. I will test them as soon as i have access to the test environment, later this week. I'll respond as soon as i can.
Cheers,
Joost
Jian An LimSolutions Architect
Top Expert 2016

Commented:
provided sufficient information

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial