Hi Experts,
I have to delete emails from particular mailbox with specific conditions:
1) received by few specific email ids
2) between specific time stamp / period ( ex: from august month to November month)
My environment is Exchange 2010
Technology Tips and News
Hi Experts,
I have to delete emails from particular mailbox with specific conditions:
1) received by few specific email ids
2) between specific time stamp / period ( ex: from august month to November month)
My environment is Exchange 2010
Not matching My requirement.............
I need to delete all the mails from my mail box from few particular user ids for specific time stamp.
example: just mails from users A, B, C between dates x & y months
Get-Mailbox -identity John | Search-Mailbox -SearchQuery "From:thomas@contoso.com","Received:> $('1/01/2010') and Received:< $('12/31/2014')" -TargetMailbox test -TargetFolder test -DeleteContent -loglevel full
Thanks for Reply. I will try and let you know
Hi,
I have a test in my environment using Exchange 2010, I recommend you refer to the following cmdlet to delete the messages from some specified users between specified period.
Get-Mailbox -identity xxx | Search-Mailbox -SearchQuery 'From:amy01@contoso.com AND Received:> 01/01/2010 AND Received:< 13/10/2014' -TargetMailbox amy01 -TargetFolder "test" -DeleteContent -loglevel full
Note: The above date formats should be consistent with the data formats in your server.
Hope this can be helpful to you.
Best regards,
Hi Siraj,
If you want to specify multiple from addresses you can try below.
Get-Mailbox -identity john | Search-Mailbox -SearchQuery "From:thomas@nsportq8.com -or From:mas@nsportq8.com","Received:> $('1/01/2010') and Received:< $('12/31/2014')" -TargetMailbox test -TargetFolder test -DeleteContent -loglevel fullThis will search John's mailbox for emails from thomas@contoso.com and mas@contoso.com which is received between 1-1-2010 and 31-12-2014 and delete it. And you can see the deleted items details in test folder in test mailbox
Troy,
Similarly if i want to delete email in organization wide using the time stamp, how can i do it? based on key word and time stamp.