Unable to delete email from mailbox using powershell
Home › Forums › Messaging Software › Exchange 2007 / 2010 / 2013 › Unable to delete email from mailbox using powershell
Tagged: exchange 2013
- This topic has 0 replies, 1 voice, and was last updated 1 year, 7 months ago by
hormiles.
-
AuthorPosts
-
hormilesMemberJun 27, 2019 at 12:09 pm #618171Hi I am trying to use Exchange Powershell to delete a message from some mailboxes on an Exchange 2013 server.
$Mailboxes = “list of users”
$MailBoxes = Get-Mailbox | fl Alias,Database,RecoverableItemsquota,RecoverableItemsWarningQuota,LitigationHoldEnabled,UseDatabaseQuotaDefaults
Check to make sure mailboxes are not on litigation hold.
Returns no mailboxes on litigation holdSearch for the the email in the mailbox(s)
$Mailboxes | Get-Mailbox | search-mailbox -SearchQuery { From:”[email protected]” } -EstimateResultOnly
Returns the mailboxes show that the email is in the mailbox
Identity : someuser
TargetMailbox :
Success : True
TargetFolder :
ResultItemsCount : 1
ResultItemsSize : 34.45 KB (35,280 bytes)$Mailboxes | Get-Mailbox | where {$_.SingelItemRecoverEnabled -ne “True”} | ft Name, SingelItemRecoverEnabled
returns mailbox showing SinggleItemRecoverEnabled is $False or Null for this mailbox.Attempt to delete the email from the mailbox with the exact searhquery
$Mailboxes | Get-Mailbox | search-mailbox -SearchQuery { From:”[email protected]” } -TargetMailbox $targetmailbox -TargetFolder $targetfolder -LogLevel full -DeleteContent -Force
Identity : someuser
TargetMailbox : some.company.com/SafeHouse/Service Accounts/DiscoverySearchMailbox
{D919BA05-46A6-415f-80AD-7E09334BB852}
Success : True
TargetFolder : \$targetmailbox\-6/27/2019 3:28:50 PM
ResultItemsCount : 0
ResultItemsSize : 0 B (0 bytes)Anyone have a clue why this woul fail to delete the message
-
AuthorPosts
You must be logged in to reply to this topic.