Solved

Remove all trace of emails from a domain user in Exchange 2010?

Posted on 2016-10-28
4
34 Views
Last Modified: 2016-10-31
Hi,

We have to remove all traces of a user from Exchange 2010. Can anyone recommend the best way of doing this?

Once the mailbox has been deleted through Powershell, we'd also need to delete any emails that others in the same Exchange database have received from the user in question, and also sent to the user in question.

Thanks.
0
Comment
Question by:e-matters
4 Comments
 
LVL 15

Accepted Solution

by:
Ivan earned 250 total points
ID: 41864151
Hi,

if you want to search all mailboxes, then you need to use multi-mailbox search function.

Take a look at this MS article about it: https://technet.microsoft.com/en-us/library/dd298173(v=exchg.141).aspx

Command should be: Get-Mailbox | Search-Mailbox -SearchQuery 'from:user@domain.com' -DeleteContent

I would run it first, with -WhatIf command, to make sure it will do what is required
Get-Mailbox | Search-Mailbox -SearchQuery 'from:user@domain.com' -DeleteContent -WhatIf

Regards,
Ivan.
0
 
LVL 33

Expert Comment

by:paulmacd
ID: 41864221
Looking forward to reading about this court case in the news, by the way.  I hope you don't end up being the one on trial!
0
 
LVL 29

Assisted Solution

by:ScottCha
ScottCha earned 250 total points
ID: 41864314
One thing to keep in mind is that if any of the users are using .PST files for archiving, and any of these unwanted emails are in those files/folders then you'd have to be sure to search and scan those as well.  Also, any individually saved emails will have to be manually found.

And don't forget if any of those emails were printed and there is a hard copy.

Flash drives, external media, etc.....
0
 

Author Closing Comment

by:e-matters
ID: 41867307
Thanks for the comments. All sorted.

Firstly I gave myself permissions:
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User myusername

Then I ran the following commands:

Get-Mailbox | Search-Mailbox -SearchQuery "from:foo@bar.com" -DeleteContent

Get-Mailbox | Search-Mailbox -SearchQuery "to:foo@bar.com" -DeleteContent

At first I got the following error, which other also seem to have had, and which prompted the initial request for help:

"The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
 + CategoryInfo : InvalidArgument: (User:PSObject) [Search-Mailbox], ParameterBindingException
 + FullyQualifiedErrorId : InputObjectNotBound,Search-Mailbox" for every mailbox.

This was because I was in the same Exchange Shell Window and the permissions change I did hadn't obviously been applied (Doh!). New Exchange Shell window was needed.

Mailbox was then removed. No PSTs in place.  Exchange tidied up and 16Gb of space freed up in the store.

No legal issues - the "user" was a temporary Sharepoint site.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now