street9009
asked on
Powershell - Delete Contacts from "Contacts" folder only
I'm working with an Exchange 2016 server (on-prem) and I'd like to run a PowerShell command to remove contacts from a user's mailbox, but only from the "Contacts" folder. If the user has any custom folders, I would not want to touch those.
This command works, but it deletes all contacts from all folders. Is there a way to restrict this command (or another like it) to only the default "Contacts" folder?
search-mailbox -identity USERNAME -searchquery kind:contacts -deletecontent
This command works, but it deletes all contacts from all folders. Is there a way to restrict this command (or another like it) to only the default "Contacts" folder?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OWA and/or Outlook won't work as I need to be able to do this en-masse. Is there any kind of tool at all that can do this or am I out of luck?
I would never say there is no 3rd party tool for that, but not one that i know of.
add target folder in the above query should work for you.