Link to home
Start Free TrialLog in
Avatar of ITHastings
ITHastingsFlag for United States of America

asked on

Delete all outlook contacts in a mailbox - powershell command? Exchange 2007

I have an android user who's contacts got super-duplicated...he has multiple hundred copies of every contact, over 350,000 total. I am not able to manipulate the contacts at all in outlook, the client freezes and crashes when you try to do anything. I'm hoping somebody knows of a powershell command or some way to manipulate the mailbox on the server side, and delete all of his contacts?

I found reference to a powershell string:
search-mailbox -identity USERNAME -searchquery kind:contacts -deletecontent
but it errors out saying it doesn't recognize the cmdlet "search-mailbox" - might be part of exchange 2010 and not available in 2007?
Avatar of pclinuxguru
pclinuxguru
Flag of United States of America image

Well you can try this.

Login to the web access and delete it from there.

If outlook only crashes when you click on Contacts but still can view mail

Click Tool -> Address Book -> Dropdown and select address book

Wait till it load and select all and delete.
ASKER CERTIFIED SOLUTION
Avatar of suriyaehnop
suriyaehnop
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITHastings

ASKER

In case anyone has the exact same problem and wants the specific command, I used this:

Export-Mailbox -Identity USERNAME -IncludeFolders '\Contacts' -DeleteContent