Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-10-28
4
Medium Priority
?
75 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 17

Accepted Solution

by:
Ivan earned 1000 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 32

Assisted Solution

by:Scott C
Scott C earned 1000 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
Want to know how to use Exchange Server Eseutil command? Go through this article as it gives you the know-how.
In this video we show how to create a mailbox database 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 Servers >> Data‚Ķ
how to add IIS SMTP to handle application/Scanner relays into office 365.
Suggested Courses

610 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