

$SearchQuery = 'subject:"important notice"'Ĭommonly used parameter with Search-Mailbox The Search Query is using Keyword Query Language (KQL) and refer to the following commonly used SearchQuery for reference # Email send from SENDER Search-Mailbox -Identity $User -SearchQuery $SearchQuery. Search for a particular Email in user’s mailbox and copy to other mailbox for reference $User = " " Search for a particular Email in user’s mailbox and delete it permanently $User = " " Search-Mailbox -Identity $User -SearchQuery $SearchQuery -EstimateResultOnly Search for a particular Email in user’s mailbox $User = " " Credential $Credential -Authentication Basic -AllowRedirection $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri ` New-ManagementRoleAssignment -SecurityGroup "Organization Management" -Role "Mailbox Import Export"ĭisconnect the existing PowerShell Session for Exchange #Disconnect existing Exchange Session Mailbox Search can no longer be used with the announcement of Retirement of legacy eDiscovery toolsĪdd Mailbox Search and Mailbox Import Export Roles to Organization Management Group New-ManagementRoleAssignment -SecurityGroup "Organization Management" -Role "Mailbox Search" There is no option to delete search items in GUI, but to use PowerShell – New-ComplianceSearchAction Mailbox Search
#Clean email login download
Go to Export and highlight the export job to download the result (PST File) using Internet Explorer Verify the result / items found once the Content Search is completed successfullyĬlick on More > Export Results to export the result to PST File Select Specific Locations and Click on Choose Users, Groups or Teams to select the user’s mailbox.Įnter Keywords you would like to search for or click Add Conditions to specific email related search, like sender, recipients, subject and etc. Login to Compliance & Security Center – Content Search and click Guided Search Only maximum of 10 items per mailbox can be removed at one timeĭelete email from from mailbox with New-ComplianceSearchAction New-ComplianceSearchAction -SearchName $Name -Purge -PurgeType SoftDelete -Force Name ContentMatchQuery Items SuccessResultsĮmail from from: 2 Get-ComplianceSearch $Name | Select Name, ContentMatchQuery, Items, SuccessResults

#Clean email login mod
# Verify the ComplianceSeach is completed successfullyĮmail from MOD Administrator 1:47:17 AM Completed Start Compliance Search and verify the result Start-ComplianceSearch -Identity $Name

-ExchangeLocation – All for all users’ mailboxes or for users or group mailbox.# Login to Exchange Online with MFA Enabled with EXO v2Ĭonnect-ExchangeOnline -UserPrincipalName $UserName -ShowProgress $trueĬonnect-IPPSSession -UserPrincipalName $UserNameĪssign to member of eDiscovery Administrator & Compliance Administrator groups Add-RoleGroupMember "eDiscoveryManager" -member Īdd-RoleGroupMember "ComplianceAdministrator" -member New-ComplianceSearchĬreate a new Compliance Search to search for all email from in AllanD Mailbox only $Name = "Email from " $credential = New-Object ($UserName,$Password)Ĭonnect-MsolService -Credential $Credential $Password = ConvertTo-SecureString "xxxxxxxxxxxxx" -AsPlainText -Force Login to MSOL, Exchange Online v2 and Securiry & Compliance Center – Refer to Connect To Office 365 With PowerShell for more detail #Login to Office 365
#Clean email login how to
Steps on how to delete email from user’s mailbox on O365 Compliance Search Login to Microsoft 365 with PowerShell
