Solved

exchange 2010 search-mailbox command

Posted on 2013-01-14
8
1,189 Views
Last Modified: 2013-01-15
is there a way to use search mailbox to also purge the message from "deleted items"?

here is the syntax i have for targeting members of a specific DG:

Get-DistributiongroupMember myDGlist | Search-Mailbox -SearchQuery subject:"FW: Payroll alert" -DeleteContent

thx in advance.

S.
0
Comment
Question by:siber1
[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
  • 2
  • 2
8 Comments
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38776987
Yes there is no such command that will only look at Deleted Items folder or XYZ folder .... simply entire mailbox for the Filter

Get-DistributiongroupMember myDGlist | Search-Mailbox -SearchQuery "subject:FW: Payroll alert" -DeleteContent

- Rancy
0
 

Author Comment

by:siber1
ID: 38777070
so there is no way to fully purge from the target mailboxes?
0
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38777077
Yes this will purge the data from the Mailboxes that you will run against

- Rancy
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 40

Expert Comment

by:Subsun
ID: 38777873
As mentioned above Search-Mailbox will not do a folder lever search..

Other possible option is with EWS Managed API and Powershell, following articles are good references to start with..

Ref : http://www.mikepfeiffer.net/2011/04/powershell-script-cmdlets-for-managing-e-mail-items-using-the-exchange-web-services-managed-api/

http://www.eveningread.com/2011/05/exchange-item-level-manipulation-with.html


Else why not create retention policy  for deleted items folder? (Require Exchange Enterprise CAL)
Ref: http://technet.microsoft.com/en-us/library/bb123548(v=exchg.141).aspx
or create a GPO to enable purge deleted items on exit option for in outlook?
0
 

Author Comment

by:siber1
ID: 38779107
Rancy, yes but this just moves the message to the deleted items folder does it not?

for example, in our case a highly sensitive message was accidentally sent to the wrong DG. I'm looking for a way to fully purge this from the mailboxes that received the message. so that there is not way they can read it. not just move the message to their deleted items folder.

thx
0
 

Author Comment

by:siber1
ID: 38779125
thx Subsun. ill take a look at that
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38779642
for example, in our case a highly sensitive message was accidentally sent to the wrong DG. I'm looking for a way to fully purge this from the mailboxes that received the message. so that there is not way they can read it. not just move the message to their deleted items folder.

For this purpose definitely you can use Search-Mailbox..
Get-Mailbox -Filter {(memberofgroup -eq "CN=ALLUsers,OU=DL,DC=Domain,DC=com")} -ResultSize Unlimited | Search-Mailbox -SearchQuery "Subject:'highly sensitive message'" -TargetMailbox Adminmailbox -TargetFolder "highly sensitive-DeletedMessages" -LogLevel Full -DeleteContent

Open in new window

Or
Get-DistributiongroupMember myDGlist | Search-Mailbox -SearchQuery "Subject:'highly sensitive message'" -TargetMailbox Adminmailbox -TargetFolder "highly sensitive-DeletedMessages" -LogLevel Full -DeleteContent

Open in new window


Should work.. This will move the emails from users mailbox to Adminmailbox folder "highly sensitive-DeletedMessages".
0
 

Author Closing Comment

by:siber1
ID: 38779714
excellent. just tested and verfied this works exactly as i was looking for. many thanks!
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

717 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