locked
How to erase content (emails) from the public folder with powershell RRS feed

  • Question

  • Hi,

    I'm trying to figure out if it's possible to erase emails from public folders (o365) using PS.  So basically I want to erase everything from my public folder tree for all public folders. I want only too keep empty public folder structure tree with no data in it. 


    Thursday, November 17, 2016 10:33 AM

Answers

  • Hi Tim,

    thank you but not exactly what I'm looking for. I don't look for specific email in these folders, this was needed for the migration of the public folders. Idea was to export local PF and import in O365 so I have structure of these folders in O365. I did this and I had to manually remove emails from some 100 PF (thank god there were no more folders :)). 

    gr 

    • Marked as answer by Nopke Monday, December 5, 2016 6:53 AM
    Monday, December 5, 2016 6:53 AM

All replies

  • Hi Nopke,

    You will need to create a new content search to search for the emails that you need deleted.

    Initial Article

    https://support.office.com/en-us/article/Search-for-and-delete-email-messages-in-your-Office-365-organization-3526fd06-b45f-445b-aed4-5ebd37b3762a

    New content search using the GUI

    https://support.office.com/en-us/article/Run-a-Content-Search-in-the-Office-365-Security-Compliance-Center-61852fd9-fe8a-4880-a339-cb19ed3bff4a?ui=en-US&rs=en-US&ad=US#create goes through creating the search using the GUI.

    New-compliance cmdlet for PowerShell

    https://technet.microsoft.com/library/mt210905(v=exchg.160).aspx is the cmdlet new-compliance search to use in PowerShell. 

    Follow the steps from the first URL (Initial Article) I posted and it gives you a step by step of the actions you need to take.

    Hope this helps.


    Thanks, Tim. | Please remember to mark the replies as answers if they help. |



    • Edited by Tim Haintz Thursday, November 17, 2016 11:14 AM
    Thursday, November 17, 2016 11:10 AM
  • Hi Tim,

    thank you but not exactly what I'm looking for. I don't look for specific email in these folders, this was needed for the migration of the public folders. Idea was to export local PF and import in O365 so I have structure of these folders in O365. I did this and I had to manually remove emails from some 100 PF (thank god there were no more folders :)). 

    gr 

    • Marked as answer by Nopke Monday, December 5, 2016 6:53 AM
    Monday, December 5, 2016 6:53 AM
  • Ouch, thanks for the info Nopke. 100 still would have been fun...

    Thanks, Tim. | Please remember to mark the replies as answers if they help. |

    Thursday, December 8, 2016 9:23 AM