Solved

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

Posted on 2016-10-28
4
44 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 16

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 34

Expert Comment

by:Paul MacDonald
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In this video we show how to create a Contact 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 >> Contact ta…

920 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

16 Experts available now in Live!

Get 1:1 Help Now