Skip to main content

Content Search and Email Purge

Description



Content Search and Email Purge

Resolution


  1. Open M365 portal and go to the compliance center/Microsoft Purview.  https://compliance.microsoft.com
  2. Go to "Permissions" underneath "Roles & Scopes"
  3. Under Microsoft Purview click Roles
  4. Click on eDiscovery Manager
  5. Add your admin account as an "eDiscovery Admin"
  6. Sign out and back in for this to take effect
  7. Go back to Microsoft Purview
  8. Go to the "Content Search" tab
  9. Create a new search
  10. Give a name
  11. Select locations you wish to search. Exchange mailboxes and public folders are recommended. For Exchange mailboxes, you can select specific users or groups.
  12. Add the conditions and keywords you wish to search by.
  13. Review and click "Submit"
  14. Once back on the content search page, refresh until the search status is completed. One the search and click "Review sample". This will allow you to validate the emails that were found in the search. If purging emails, validate there is not anything in here you do not wish to delete.
  15. Open PowerShell
  16. Install-Module -Name ExchangeOnlineManagement (this should only be needed the first time)
  17. Import-Module ExchangeOnlineManagement
  18. If you get an error message stating  "cannot be loaded because running scripts is disabled on this system."
    1. Run the command without quotes "Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass"
  19. Connect-IPPSSession -UserPrincipalName  qp_365_admin@customerdomain.com - This will bring up an interactive login prompt.
  20. Get-ComplianceSearch -  This should bring up a list of searches, verify the one you created is in the list.
  21. New-ComplianceSearchAction -SearchName "test1" -Purge -PurgeType SoftDelete then hit "A"" - This will soft delete everything in the search
  22. To see the progress of the search run: Get-ComplianceSearchAction Status will show completed when done.
  23. Disconnect-ExchangeOnline to end the session