Link to home
Start Free TrialLog in
Avatar of Jerry Seinfield
Jerry SeinfieldFlag for United States of America

asked on

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

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
Avatar of Tony J
Tony J
Flag of United Kingdom of Great Britain and Northern Ireland image

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

Avatar of Jerry Seinfield

ASKER

Thanks Tony,

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

Can you please buld the ps script for this?
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?
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
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?
Any updates Experts?

Can anyone provide me with the script to recall messages from a DL that contains multiple sub-DLs?
ASKER CERTIFIED SOLUTION
Avatar of Tony J
Tony J
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was expecting another answer for the DL request