?
Solved

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

Posted on 2011-03-15
8
Medium Priority
?
2,277 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
[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
  • 3
8 Comments
 
LVL 26

Expert Comment

by:Tony J
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 26

Expert Comment

by:Tony J
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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
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
 

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 26

Accepted Solution

by:
Tony J earned 1500 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
I don't pretend to be an expert at this, but I have found a few things that are useful. I hope that sharing them here will help others, so they will not have to face some rather hard choices. Since I felt this to be a topic of enough importance and…
In this video we show how to create a Shared Mailbox 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 >> Sha…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Suggested Courses

765 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