Delete a folder within a Mailboxbox Office365

Alan 1 Reputation point
2021-03-13T10:15:56.663+00:00

I struggling to delete a specific folder with Office365 Exchange online Get-MailboxFolderStatistics mailbox in question | Select Name,FolderSize,ItemsinFolder This is the folder: Auto replies 8.721 GB (9,363,929,634 bytes) Tried PS C:\WINDOWS\system32> Search-Mailbox -Identity mailboxname -SearchQuery '#Auto replies#' -DeleteContent WARNING: WARNING: On July 1, 2020, the Search-Mailbox cmdlet is being retired and Microsoft Support will no longer provide assistance. See https://go.microsoft.com/fwlink/?linkid=2113221 to learn more. WARNING: The Search-Mailbox cmdlet returns up to 10000 results per mailbox if a search query is specified. To return more than 10000 results, use the New-MailboxSearch cmdlet or the In-Place eDiscovery & Hold console in the Exchange Administration Center. Confirm Deleting content from mailboxes mailbox name [Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): Y Deletion failed with error 'Move/Copy messages failed.' for the following item: Client Services,"A - Matched ","[Calltracks Ltd] Re: Re: 21838 Numbers for porting",False,3/12/2019 2:41:01 PM,3/12/2019 2:41:05 PM,Calltracks Support Team,support@calltracks.com,RgAAAABB7TM26szqRYgvSxJV39WXBwBT3afQZU+FSbg64qtOITreAAFwiDupAABT3afQZU+FSbg64qtOITreAAHxsxvHAAAJ Deletion failed with error 'Move/Copy messages failed.' for the following item: Client Services,"A - Matched ","[Calltracks Ltd] Re: Re: 21838 Numbers for porting",True,3/12/2019 2:57:19 PM,3/12/2019 2:57:23 PM,Calltracks Support Team,support@calltracks.com,RgAAAABB7TM26szqRYgvSxJV39WXBwBT3afQZU+FSbg64qtOITreAAFwiDupAABT3afQZU+FSbg64qtOITreAAHxsxvLAAAJ Deletion failed with error 'Move/Copy messages failed.' for the following item: Client Services,"A - Matched ","Request #94495: How would you rate the support you received?",False,3/13/2019 3:02:30 PM,3/13/2019 3:02:38 PM,Calltracks Support I think I've installed the new module but can't get it to work either: PS C:\WINDOWS\system32> Install-Module -Name ExchangeOnlineManagement Untrusted repository You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A PS C:\WINDOWS\system32> Import-Module -Name ExchangeOnlineManagement PS C:\WINDOWS\system32> Connect-ExchangeOnline -Credential $credentials ---------------------------------------------------------------------------- The module allows access to all existing remote PowerShell (V1) cmdlets in addition to the 9 new, faster, and more reliable cmdlets. |--------------------------------------------------------------------------| | Old Cmdlets | New/Reliable/Faster Cmdlets | |--------------------------------------------------------------------------| | Get-CASMailbox | Get-EXOCASMailbox | | Get-Mailbox | Get-EXOMailbox | | Get-MailboxFolderPermission | Get-EXOMailboxFolderPermission | | Get-MailboxFolderStatistics | Get-EXOMailboxFolderStatistics | | Get-MailboxPermission | Get-EXOMailboxPermission | | Get-MailboxStatistics | Get-EXOMailboxStatistics | | Get-MobileDeviceStatistics | Get-EXOMobileDeviceStatistics | | Get-Recipient | Get-EXORecipient | | Get-RecipientPermission | Get-EXORecipientPermission | |--------------------------------------------------------------------------| My powersheeling script is quite weak any help would be really appreciated

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,173 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,347 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Joyce Shen - MSFT 16,641 Reputation points
    2021-03-15T07:20:13.753+00:00

    Hi @Alan

    Is there any update about your issue?

    Note: In cloud-based environments, the Search-Mailbox cmdlet is being deprecated in favor of New-ComplianceSearch and related eDiscovery cmdlets.

    In O365, we can use the methods introduced in the offcial document Search for and delete email messages

    You can create the search by using the Security & Compliance Center or by running the New-ComplianceSearch and Start-ComplianceSearch cmdlets. However, a maximum of 10 items per mailbox can be removed at one time. For this limitation, we could refer to the discussion in this thread: Is there a way to delete more than 10 items at a time from the RecoverableItems folder?


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
     

    0 comments No comments