• Status: Solved
  • Priority: Medium
  • Security: Private
  • Views: 39
  • Last Modified:

Removing a folder powershell exchange 2010

I am wondering is there a way to remove a folder of either a users mailbox or a shared mailbox with powershell. I am in a 2010 environment and have been using the search-mailbox with the advanced searchquery with no luck. Have anyone been able to remove a folder and its contents using this command.
0
techdrive
Asked:
techdrive
  • 2
  • 2
1 Solution
 
Adam BrownSr Solutions ArchitectCommented:
It's possible to do this with the search-mailbox cmdlet using the -deletecontent switch. https://technet.microsoft.com/en-us/library/ff459253(v=exchg.150).aspx goes over how to do this. You would need to craft a search query that returns the folder, but once you have that is should work well for you.
0
 
timgreen7077Exchange EngineerCommented:
I don't think you can remove a folder with the search-mailbox cmdlets. I actually don't know of a way to delete folders from mailboxes in exchange using the shell. i have looked into this before and never found any true solutions using the exchange shell. i would suggest give yourself access to the mailbox and remove it that way.
0
 
techdriveAuthor Commented:
Thank you timgreen7077 I think you are absolutely correct. I tried this yesterday and it moved the contents in the folder but not the folder itself.
0
 
timgreen7077Exchange EngineerCommented:
sure thing.
0
 
techdriveAuthor Commented:
thanks
0
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

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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