简体   繁体   中英

Mass Delete empty sub folders in Office 365 via Power Shell

In Office 365, when sub folders of the Inbox of their mailbox are moved to the Online Archive, it leaves the Folder/Subfolder empty in the mailbox.

Can that folder be purged without affecting the Online archive? A

nd if so, how can I purge empty sub folders via PowerShell in O365?

This is how to find all Empty Folders :

Get-MailboxFolderStatistics user@domain.com | Where {$_.ItemsInFolder -eq 0} | Select Identity

Deletion can be done using EWS

https://blogs.technet.microsoft.com/exovoice/2017/01/12/delete-a-list-of-folders-from-specific-mailboxes-with-ews-managed-api-2-2-and-application-impersonation-in-exchange-online/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM