22 Ağustos 2012 Çarşamba

Get-Mailbox Search-Mailbox -SearchQuery

Searching and deleting email containing attachment spam.csv in all the mailbox in the organization
get-mailbox -resultsize unlimited | Search-Mailbox -SearchQuery attachment:"spam.csv" -DeleteContent
Searching and deleting emails containing attachment spam.csv and subject is hi against all the mailbox in the organization
get-mailbox -resultsize unlimited | Search-Mailbox -SearchQuery 'attachment:"spam.csv" and subject:Hi' -DeleteContent
If you wanted to display the details of the search result on the shell then you need to use the option Estimateresultonly
get-mailbox -server | Search-Mailbox -SearchQuery 'attachment:"spam.csv" and subject:Hi' -Estimateresultonly
Delete all the email from all the mailbox of a before the specific date. In the below example I am deleting all the email before the date 18th Sep 2011(“dd/mm/yyy’)
get-mailbox -database -resultsize unlimited | Search-Mailbox -SearchQuery Received:<$("09/18/201") -deletecontent
Delete all the email from all the mailbox of a database between the specific dates. In the below example I am deleting all the email before the date 18th Sep 2011(“dd/mm/yyy’) – 1st Jan 2012
get-mailbox -database -resultsize unlimited | Search-Mailbox -SearchQuery Received:<$("09/18/2011") –deletecontent
Delete all the email from the mailbox between the specific date
Search-Mailbox -Identity -SearchQuery 'Received:>$("09/18/2011") and Received:<$("01/27/2012")` -deletecontent
Delete all the email from yesterday against the member of the distribution group.
get-DistributiongroupMember Orgvip | Search-Mailbox -SearchQuery Received:today -deletecontent -confirm:false  
Delete all the email on a specific date from a specific mailbox.
Search-Mailbox -SearchQuery Received:01/27/2012 -deletecontent


Hiç yorum yok:

Yorum Gönder