Using shell command in Exchange that is supposed to remove an email sent to all users but running into one issue.
Hello, I had checked the Related Topics in Exchange FAQ2/FAQ3 but wasn't able to find exactly the response we were looking for. First, we are running Exchange 07 SP2 with Office 2003. An email was sent to all our users that we would like to delete from everyone's mailbox. After some serious searching online, we located this script: Get-Mailbox -Server ExchangeServer | Export-Mailbox -TargetMailbox UserName -TargetFolder MessageCleanup -SenderKeywords email@domain.com -DeleteContent -MaxThreads 10 (ExchangeServer=Server Name, UserName=Mailbox that content would be moved to, email@domain.com=email address you'd like to search for) The script does work, extracting the email we had specified and only that email, except for some users. For these users it pulls not only the email but seemingly everything in the folder that the email we are trying to delete is located in. Is there something incorrect with the script? May someone please help with correcting the issue or fixing the issue wit the importing of all mail from some users? Please let me know if more information is needed. We are thankful for any help with this.
April 28th, 2010 10:54pm

Just wanted to include an update: I created a test email account called export mailbox to run the Command with. The command above works, and it pulls only the email address I specified. It left all the other emails alone. Items that are pulled from the Deleted Items folder are still recoverable if the User goes to Tools > Recover Deleted Items. But if it as pulled from Inbox or any other folder it will be permanently deleted. Again, not sure why it worked successfully with this test mailbox, and what would make it pull items other than the email specified for it to pull. Any input is greatly appreciated.
Free Windows Admin Tool Kit Click here and download it now
April 29th, 2010 4:27am

The only qualifier you've put on th delete is the presence of a particular email address. Since you're looking for a specific email, you can further qualify it by also flitering on the message subject, and a start and end date for a time frame the email would have been received. The more qualifiers you can put on the search, the less likely it wll be that it will pick up other emails you didn't want to include. http://technet.microsoft.com/en-us/library/bb676491(EXCHG.80).aspx
April 29th, 2010 4:43am

Thank you for your reply! With regards to the qualifier being a particular email address, it was because we are 100% sure that this was the only time we have received an email from this particular email address. The command worked for some Users, but for other Users it would not only pull the target email, but also pull all other emails from which the target email was located. Was the reason for this issue because I had lacked more qualifiers? And why would it work for some users but not others? Again, thank you for your help!
Free Windows Admin Tool Kit Click here and download it now
April 29th, 2010 5:01am

I can't tell you what all the possible causes might be, or which one it is. If you want to investigate further, I'd start by restoring one of the affected mailboxes, and re-running it without the -DeleteContent switch. Examine the emails and see if there's a reason the filter would have hit them. If there's no apparent reason, you might want to look at / rebuild the search indexes or open a call with PSS for assistance.
April 29th, 2010 5:10am

Unfortunately, using more qualifiers still did not fix the issue. Not only that but I am not able to find any consistency as for ex. It pulled only the original email from the User's inbox, but pulled the original plus replies or forwards that are in the Sub-folders. The parameters I added were -SubjectKeywords "TypeSubjectHere" and -ContentKeywords TypeContentHere It pulls the emails I need, but also pulls extras that do not have any of the information in the search parameters. It also only pulls the original from the Inbox, but all emails matching the parameters in the Subfolder. Along with all the matching emails it also pulls extra emails that do not match the search parameters. It's as if I am missing a command to also search Subfolders, except for the fact it does pull results. The results are copies of what is in the user's mailbox. Any response or help is greatly appreciated. I would like to know a solution to this issue so that in the future I can resolve this in a timely manner in case it ever happens again. Thank you your replies so far mjolinor
Free Windows Admin Tool Kit Click here and download it now
April 29th, 2010 9:43am

Does the issue only reproducible for those users who had the symptom before? Please add the -verbose after the Export-Mailbox to check more on the output Please also increase the diagnostic logging level, see if that can give you more information MSExchangeIS\9000 Private\Background CleanupJames Luo TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx) If you have any feedback on our support, please contact tngfb@microsoft.com
April 29th, 2010 12:27pm

Hello James, I am able to reproduce the the issue for a user who has had this issue before. I will try what you have suggested, and see what that produces. Thank you for your help so far.
Free Windows Admin Tool Kit Click here and download it now
April 29th, 2010 8:06pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics