Friday 12 September 2014

Advanced Search Query

Use the Search-Mailbox cmdlet for the following scenarios

1. Deleting the meetings from the end user calendar.

2. Delete the Mail from the end user Mailbox

3. Copy the mails from one mailbox to other mailbox

4. Delete the meetings made by terminated users

5. Delete the meeting from Resource mailbox


Use the below cmdlet for taking the backup and see what emails you are going to recall. So if anything goes wrong you could use this backed up emails. 

search-mailbox -searchquery "kind:meetings from:$recipient" -targetmailbox $yourmailid -targetfolder "REPORT" 

Check $yourmailid to see what meetings you are going to delete. If you are ok then go ahead and use delete parameter for deleting the meeting

search-mailbox -searchquery "kind:meetings from:$recipient"  -deletecontent -force

Use the below cmdlet for copying emails from one mailbox to another mailbox


Search-Mailbox mailid@domain.com -SearchQuery "Kind:email AND sent: 06/01/14..09/16/14" -TargetMailbox sankar@domain.com  -TargetFolder Backup