Solved

Script to recall message from all mailboxes in Exchange 2007-2010

Posted on 2011-03-15
8
2,183 Views
Last Modified: 2012-05-11
Hello Experts,

Can anyone help me to build an script to do

Given a DL, or distribution group in AD that contains multiple sub-DLs and users.

Given an Exchange server, or multiple Exchange/Databases

Delete a message for all users in that DL and /or exchange/database server with subject is Virus, and export deleted messages into another mailbox?

I have this pw shell command for a single user and works fine

Get-Mailbox xxxx | Export-Mailbox -SenderKeywords "xxxx@xxxxxx.com" -SubjectKeywords "Virus" -StartDate "12/07/2010 7:09:00" -EndDate "12/07/2010 7:11:00" -TargetMailbox xxxxxxxx -TargetFolder ConfidentalData -Deletecontent -confirm:$false

Please be aware I am not a programmer, please indicate as many details as you can

Thank you in advance
0
Comment
Question by:Jerry Seinfield
  • 4
  • 3
8 Comments
 
LVL 25

Expert Comment

by:Tony1044
ID: 35146581
I'm not sure about at a DL level, but for database, try the following:

Get-Mailbox -Database "SERVER\First Storage Group\Mailbox Database" | Export-Mailbox -SenderKeywords "xxxx@xxxxxx.com" -SubjectKeywords "Virus" -StartDate "12/07/2010 7:09:00" -EndDate "12/07/2010 7:11:00" -TargetMailbox xxxxxxxx -TargetFolder ConfidentalData -Deletecontent -confirm:$false

0
 

Author Comment

by:Jerry Seinfield
ID: 35146936
Thanks Tony,

What if I have 20 CCR cluster and each cluster has 5 databases?

Can you please buld the ps script for this?
0
 
LVL 25

Expert Comment

by:Tony1044
ID: 35147078
That would be a complex script to build - not 5 mins work I think.

You can do it against OU as you originally asked with the following:

Get-Mailbox -OrganizationalUnit Marketing

I don't know if that might be any easier?
0
 
LVL 12

Expert Comment

by:prashanthd
ID: 35147221
You can also run against each exchange server, just replace servrname with the Server name

Get-Mailbox -server servername | Export-Mailbox -SenderKeywords "xxxx@xxxxxx.com" -SubjectKeywords "Virus" -StartDate "12/07/2010 7:09:00" -EndDate "12/07/2010 7:11:00" -TargetMailbox xxxxxxxx -TargetFolder ConfidentalData -Deletecontent -confirm:$false
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:Jerry Seinfield
ID: 35147802
Hi Tony,

Thanks for the information.

Basically, I need to script recall messages from a DL that contains multiple sub-DLs and users.

Can you please build an script for me based on that information and powershell command I attached above?
0
 

Author Comment

by:Jerry Seinfield
ID: 35160330
Any updates Experts?

Can anyone provide me with the script to recall messages from a DL that contains multiple sub-DLs?
0
 
LVL 25

Accepted Solution

by:
Tony1044 earned 500 total points
ID: 35163812
I think running it against a server would be your best option

Otherwise you need to google recursive powershell scripts and sub DL - they're complex scripts.
0
 

Author Closing Comment

by:Jerry Seinfield
ID: 35193158
I was expecting another answer for the DL request
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
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.
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…
This video discusses moving either the default database or any database to a new volume.

746 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

12 Experts available now in Live!

Get 1:1 Help Now