{"id":147,"date":"2021-11-24T09:03:05","date_gmt":"2021-11-24T09:03:05","guid":{"rendered":"https:\/\/standingtech.com\/randomarticles\/?p=147"},"modified":"2021-11-24T09:03:26","modified_gmt":"2021-11-24T09:03:26","slug":"office-365-delete-messages-search-for-and-delete-email-messages-microsoft-365","status":"publish","type":"post","link":"https:\/\/standingtech.com\/randomarticles\/office-365-delete-messages-search-for-and-delete-email-messages-microsoft-365\/","title":{"rendered":"office 365 delete messages  Search for and delete email messages &#8211; Microsoft 365"},"content":{"rendered":"<p>&#8211; Open Windows PowerShell as Admin<br \/>\n&#8211; Connect to Security &amp; Compliance Center PowerShell<\/p>\n<blockquote><p>$credentials = get-credential;<br \/>\nConnect-ExchangeOnline -Credential $credentials<br \/>\n$SccSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https:\/\/ps.compliance.protection.outlook.com\/powershell-liveid\/ -Credential $credentials -Authentication &#8220;Basic&#8221; -AllowRedirection;<br \/>\nImport-PSSession $SccSession<\/p><\/blockquote>\n<p>Or Go to <a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/exchange\/connect-to-scc-powershell?view=exchange-ps\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.microsoft.com\/en-us\/powershell\/exchange\/connect-to-scc-powershell?view=exchange-ps<\/a> for more information<\/p>\n<p>&#8211; Soft-delete messages<\/p>\n<blockquote><p>New-ComplianceSearchAction -SearchName &#8220;NameOfTheSearch&#8221; -Purge -PurgeType SoftDelete<\/p><\/blockquote>\n<p>&#8211; Hard-delete messages<\/p>\n<blockquote><p>New-ComplianceSearchAction -SearchName &#8220;NameOfTheSearch&#8221; -Purge -PurgeType HardDelete<\/p><\/blockquote>\n<p>&#8211; Then to see progress of the action you can run<\/p>\n<blockquote><p>Get-ComplianceSearchAction<\/p><\/blockquote>\n<p>&#8211; Or specifically you can get progress of search name<\/p>\n<blockquote><p>Get-ComplianceSearchAction &#8216;NameOfTheSearch_Purge&#8217; | Select *<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>&#8211; Open Windows PowerShell as Admin &#8211; Connect to Security &amp; Compliance Center PowerShell $credentials = get-credential; Connect-ExchangeOnline -Credential $credentials $SccSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https:\/\/ps.compliance.protection.outlook.com\/powershell-liveid\/ -Credential $credentials -Authentication &#8220;Basic&#8221; -AllowRedirection; Import-PSSession $SccSession Or Go to https:\/\/docs.microsoft.com\/en-us\/powershell\/exchange\/connect-to-scc-powershell?view=exchange-ps for more information &#8211; Soft-delete messages New-ComplianceSearchAction -SearchName &#8220;NameOfTheSearch&#8221; -Purge -PurgeType SoftDelete &#8211; Hard-delete messages New-ComplianceSearchAction -SearchName&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1],"tags":[50,49],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-office365","category-uncategorized","tag-deletemessages","tag-office365"],"_links":{"self":[{"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":1,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":148,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/posts\/147\/revisions\/148"}],"wp:attachment":[{"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}