Hi Experts i want to delete an email i am getting the below error.
i have a csv file in the below format.
i am using the below syntax
$Mailboxes = Import-Csv C:/list.csv
ForEach ($Mailbox in $Mailboxes){
New-ComplianceSearch -Name $mailbox.name -ExchangeLocation $mailbox.name -ContentMatchQuery '(Received:08/01/2020 00:00..08/01/2020 23:59) AND (Subject:"testemail") AND (From:"externalusre@ext.com")'
Start-ComplianceSearch -Identity $mailbox.name
New-ComplianceSearchAction -SearchName $mailbox.name -Purge -PurgeType SoftDelete -force
}
i am getting below error, how i delete existing compliance search using shell
The compliance search object "user1@contoso.com" already exists within your organization.
Confirm
Are you sure you want to perform this action?
This operation will make message items meeting the criteria of the compliance search "user1@contoso.com"
completely inaccessible to users. There is no automatic method to undo the removal of these message items.
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): A
Unable to execute the task. Reason: The search "user1@contoso.com" is still running or it didn't return
any results. Please wait until the search finishes or edit the query and run the search again.
If i need to delete meeting invite how do i need to delete it do i need to use Kind:meeting if so how can i add it.