How can I export only emails containing a specific keyword (e.g., "pass") from a user's mailbox on an Exchange server?
Use the `-ContentFilter` parameter with `New-MailboxExportRequest`. For example: `New-MailboxExportRequest -mailbox test1 -ContentFilter {(body -like "*pass*")} -FilePath "\\localhost\c$\test\test1.pst"`. This exports a PST file containing only emails whose body matches the filter. You can also script it to loop through all mailboxes in an OU using `Get-Mailbox -OrganizationalUnit Users -Resultsize unlimited | % {New-MailboxExportRequest -mailbox $_.name -FilePath "..." -ContentFilter ...}`.
content filteremail exportPSTkeyword searchNew-MailboxExportRequest