Search-Mailbox does just that -- it searches the mailbox.
Search Mailbox O365 and delete content in Specific Folder
Get-mailbox asif.a@keyman .com | Where {$_.Name -match "FolderName"} | search-mailbox -searchquery "Subject:'Citrix'" -EstimateResultOnly
The above cmdlet must search only on the specific folder of the MB instead it searches entire MB. I want to search only on the folderName folder
Same thing below the below cmdlet does not deletes content in the specific folder
Get-mailbox asif.a@keyman .com | Where {$_.Name -match "FolderName"} | search-mailbox -searchquery "Subject:'Citrix'" -DeleteContent
2 answers
Sort by: Most helpful
-
-
asif ahamed 201 Reputation points
2022-01-30T18:43:40.03+00:00 No , it does not work. My collogue is tried and it is not working
Get-mailbox asif.a@keyman .com | Where {$_.Name -match "FolderName"} | search-mailbox -searchquery "Subject:'Citrix'" -DeleteContent
OnFolderName folder I have only one mail with subject:Citrix but when I execute the the cmdlet and it goes to the entire mb