• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Exchange 2013 powershell

I need to delete a folder (and all entries within) from every users mailbox.
In every user's mailbox is a Folder called "oldimportmailfolder".
Can I use the Exchange powershell to go through every folder and delete it?
How do I do that?

Many thanks
2 Solutions
SeanSystem EngineerCommented:
This should do it. But i would test it on a test account first...

Search-Mailbox username@domain.com -TargetFolder oldimportmailfolder  -TargetMailbox "Discovery Search Mailbox" -DeleteContent
Vijaya Babu SekarAssociate Ops ManagerCommented:
Yes you can...

It may be helpful.

Get-Mailbox | Export-Mailbox -DeleteContent -IncludeFolders "\oldimportmailfolder"

if having subfolders, it will not delete.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now