How to delete an email from all users in Exchange 2007
HelloThere was a spam email sent out to a lot of people and I was wondering if there was a way to delete the emails in Exchange 2007. I have SP1. I did a google search but nothing really solid comes up. I've seen the exmerge for Exchange 2003 but nothing for Exchange 2007.
June 12th, 2009 8:19pm

You can use Export-Mailbox with -DeleteContent switch to export emails from all mailboxes and delete the source content. Use below articles for further information. Exchange Server 2007 Cross Mailbox Search using Export-mailbox http://msexchangeteam.com/archive/2006/12/18/431934.aspx Export-Mailbox requires to run from 32bit workstation where Exchange Management Tools and Outlook 2003 SP2 or higher installed with proper permissions on all mailboxes to perform cross mailbox search. Refer below article for further requirement and information. How to Export Mailbox Data http://technet.microsoft.com/en-us/library/bb266964.aspx Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2009 8:24pm

Solid PLANAmit, and using Export-Mailbox would be the best option.Arun Kumar | MCSE - 2K3 + Messaging | ITIL-F V3
June 12th, 2009 9:29pm

Solid PLANAmit, and using Export-Mailbox would be the best option. Arun Kumar | MCSE - 2K3 + Messaging | ITIL-F V3 Hey, welcome back dude... :)Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2009 9:32pm

AmitThanks for the suggestions. Based on the first link in senario 2 this is the command that I typed however I don't think it worked.PS> get-mailbox | Export-Mailbox ContentKeywords "Webmail User" TargetMailboxmarkc TargetFolder 'MyData' DeleteContentNow as an administrator, I have multiple mailboxes including "ITS Helpdesk". When I click on that mailbox I get an error where as I didn't before. It says Cannot display the folder. MS office outlook cannot access the specified folder location.Does the syntax seem right?
June 12th, 2009 9:42pm

Syntax looks perfect. Did you changed or configured permission to use Export-Mailbox cmdlet? Also are you able to access mailbox with OWA explicitly? How to Enable Explicit Logons in Outlook Web Access http://technet.microsoft.com/en-us/library/aa998830.aspx Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2009 9:50pm

Hi Arun, I used this command and it worked for me. But you need to have full access of all the mailboxes where you are running this command. Or you can run this command with a a/c who have access on all the mailboxes. Thanks.Regards,Sunil Bansal.
June 12th, 2009 9:58pm

AmitI did not change or configured permission to use export-mail. I have a pc that I use to do all exchange management. So I RDP into the pc and ran the exchange mgmt shell. I used the "domain admin" account to login to the server. Now just so that I'm clear when you put in "TargetMailboxmarkc" is it only going to my mailbox to search for the email or is it going to all the mailboxes to search for the emails?Because what I'm trying to do is find an email from all the mailboxes that have "webmail user" in the body of the email and have them deleted. Does this make sense?Thanks
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2009 10:02pm

Yes you need to have full permission, that is obious if you wanted to get into someone's mailbox and extract email out of it.. Like we use to have for Exmerge program in legacyArun Kumar | MCSE - 2K3 + Messaging | ITIL-F V3
June 12th, 2009 10:06pm

This cmdlet will search mails in all mailboxes and will export searched to MarkC's mailbox in MyData folder and delete the original mail from source mailbox. Just refer below article and make sure that you are following requirement to run Export-Mailbox cmdlet.. How to Export Mailbox Datahttp://technet.microsoft.com/en-us/library/bb266964.aspxAmit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2009 10:09pm

ArunHere is what I got after I ran the script. Now there is more but this is one of them.Export-Mailbox : Error was found for grants en2 (grantsen2@clackamas.edu) because: Error occurred in the step: Creating target folder in the target mailbox. An unknown error has occurred., error code: -2147221233At line:1 char:29+ get-mailbox | Export-Mailbox <<<< -ContentKeywords "Webmail User" -TargetMailbox markc -TargetFolder 'mydata' -DeleteContentIdentity : clackamas.edu/CCC Users/Other/grants en2DistinguishedName : CN=grants en2,OU=Other,OU=CCC Users,DC=clack amas,DC=eduDisplayName : grants en2Alias : grantsen2LegacyExchangeDN : /o=Clackamas/ou=Exchange Administrative Grou p (FYDIBOHF23SPDLT)/cn=Recipients/cn=grantse n2PrimarySmtpAddress : grantsen2@clackamas.eduSourceServer : MAILBOX.clackamas.eduSourceDatabase : MAILBOX\Storage Group 10 - Add Up To 80 User s Max Here\Mailbox Database 10 - Add Up To 8 0 Users Max HereSourceGlobalCatalog : DNS0SourceDomainController :TargetGlobalCatalog : DNS0TargetDomainController :TargetMailbox : clackamas.edu/CCC Users/Classified/Mark ChoiTargetServer : MAILBOX.clackamas.eduTargetDatabase : MAILBOX\Storage Group 1 - Full @ 80 users - Do Not Add More Users\Mailbox Database 1 - F ull @ 80 users - Do Not Add More UsersMailboxSize : 13KBIsResourceMailbox : FalseSIDUsedInMatch :SMTPProxies :SourceManager :SourceDirectReports :SourcePublicDelegates :SourcePublicDelegatesBL :SourceAltRecipient :SourceAltRecipientBL :SourceDeliverAndRedirect :MatchedTargetNTAccountDN :IsMatchedNTAccountMailboxEnabled :MatchedContactsDNList :TargetNTAccountDNToCreate :TargetManager :TargetDirectReports :TargetPublicDelegates :TargetPublicDelegatesBL :TargetAltRecipient :TargetAltRecipientBL :TargetDeliverAndRedirect :Options : DeleteSourceContentSourceForestCredential :TargetForestCredential :TargetFolder : \mydata\Recovered Data - grants en2 - 6/12/2 009 11:08:42 AMPSTFilePath :RsgMailboxGuid :RsgMailboxLegacyExchangeDN :RsgMailboxDisplayName :RsgDatabaseGuid :StandardMessagesDeleted : 0AssociatedMessagesDeleted : 0DumpsterMessagesDeleted : 0MoveType : ExportMoveStage : MoveStartTime : 6/12/2009 11:17:45 AMEndTime : 6/12/2009 11:17:47 AMStatusCode : -2147221233StatusMessage : Error occurred in the step: Creating target folder in the target mailbox. An unknown err or has occurred.ReportFile : C:\Program Files\Microsoft\Exchange Server\L ogging\MigrationLogs\export-Mailbox20090612- 110741-1231345.xml For one, I don't know or see a "mydata" folder. Now where is this suppose to be? Does this show up in this person's email?TargetFolder : \mydata\Recovered Data - grants en2 - 6/12/2
June 12th, 2009 10:17pm

Ok I tried everything and nothing works. I read both articles and nothing
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2009 12:12am

"Error occurred in the step: Creating target folder in the target mailbox. An unknown error has occurred." says the account, you are using to run Export-Mailbox, doesn't have Full Mailbox Access on "markc" mailbox to create folder. You can create a new account (just domain user account and don't give any admin rights except local admin permission on all Exchange server)and give full mailbox access on all mailboxes of a server with the method mentioned in my bleow article and use that account for this operation. FAQ: Access on All the Mailboxes of a Server Exchange 2007 http://exchangeshare.wordpress.com/2008/09/05/faq-access-on-all-the-mailboxes-of-a-server-exchange-2007/ Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
June 13th, 2009 1:06pm

Hi Amit, Yulook, You both ingonord my previous posting. This command work for a a/c who is having full access of all the mailboxes. Thanks. Regards, Sunil Bansal
Free Windows Admin Tool Kit Click here and download it now
June 17th, 2009 11:49pm

Hi Amit, Yulook, You both ingonord my previous posting. This command work for a a/c who is having full access of all the mailboxes. Thanks. Regards, Sunil Bansal Hey Sunil, I didn't ignore your post... :) I just wanted to turn out what is going in background when Yulook tries to run cmdlet and as Yulook told "used the "domain admin" account to login to the server", considering that it has full mailbox access and it looks to be a problem because by default Domain Admin has explicit Full Mailbox Access deny set at organization level hence getting this problem... So to run this cmdlet it is better to use a plain user account (instead of Domain Admin) and give permission on all mailboxes and go ahead of the operation.Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
June 18th, 2009 5:36am

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

Other recent topics Other recent topics