?
Solved

exchange 2010 search-mailbox command

Posted on 2013-01-14
8
Medium Priority
?
1,194 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
Four New Appliances. Same Industry-leading Speeds.

But don't take it from us.  The Firebox M370 is Miercom tested and Miercom approved, outperforming its competitors for stateless and stateful traffic throughput scenarios.  Learn more about the M370, M470, M570 and M670 and find the right solution for your organization today!

 
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 2000 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

Need protection from advanced malware attacks?

Look no further than WatchGuard's Total Security Suite, providing defense in depth against today's most headlining attacks like Petya 2.0 and WannaCry. Keep your organization out of the news with protection from known and unknown threats.

Question has a verified solution.

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

Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

800 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