Hi,
I need to keep one of the mailbox mails to be reserve present two days only and past mails are to be removed.
I have tried below command from exchange shell but it's not worked out.
Get-Mailbox -identity migrationking@domain.com | Search-Mailbox -SearchQuery 'Received:<(Get-Date).AddDays(-2).ToString('MM-dd-yyyy')' -TargetMailbox "migrationking@domain.com" -DeleteContent -loglevel full
Please suggest on this.
Regards,
Kumar N