Connect to search and delete (hanya bisa mengunakan global administrator)
Connect-IPPSSession -UserPrincipalName xxx@xxx.com
$Search=New-ComplianceSearch -Name "Remove Phishing Message" -ExchangeLocation All -ContentMatchQuery '(Subject:"Include privileged access control in your IT security strategy") and (From:communications@eu.manageengine.com)'
New-ComplianceSearch -Name "SearchSpamEmails" -ExchangeLocation "asnan.rifai@ecogeenoleo.com" -ContentMatchQuery 'subject:"Action required: Review Ruly Faizal"'
Start-ComplianceSearch -Identity $Search.Identity
soft-delete
New-ComplianceSearchAction -SearchName "Remove Phishing Message" -Purge -PurgeType SoftDelete
hard delete
New-ComplianceSearchAction -SearchName "Remove Phishing Message" -Purge HardDelete
Get-ComplianceSearch (untuk melihat compliance search)
Get-ComplianceSearchAction (untuk melihat ComplianceSearchAction)
Remove-ComplianceSearch -Identity "Remove Phishing Message" (untuk remove compliance search)
Remove-ComplianceSearchAction -Identity "Remove Phishing Message_Purge" (untuk remove ComplianceSearchAction)
disconnected to exchange
Disconnect-ExchangeOnline