Delete mails from source after exporting to pst file in exchange 2007
I have used the below command to export the emails to pst file and delete the message from exchange 2007 server mail box. I succeeded in exporting, but only deleted item mails got deleted and inbox was intact Export-Mailbox -Identity user@domainname.com -PSTFolderPath C:\mypst.pst -DeleteContentThanks Suresh
January 9th, 2009 2:47pm

Suresh,According to this Technet article:http://technet.microsoft.com/en-us/library/bb266964.aspxYou will need to specify the keyword parameter to use the deletecontent parameter.Maybe someone from MSFT can confirm this?blog: www.johanveldhuis.nl
Free Windows Admin Tool Kit Click here and download it now
January 9th, 2009 5:06pm

Hi Suresh,I also suspect the same as Johan mentioned. Can you try with -SubjectKeywords switch to see the result?Export-Mailbox -Identityuser@domainname.com-SubjectKeywords *-PSTFolderPath C:\mypst.pst -DeleteContentAmit Tank | MVP - Exchange | MCITP:EMA MCSA:M | http://ExchangeShare.WordPress.com
January 9th, 2009 8:08pm

Thanks for the reply, if I use subjectkeyword it will delete only those emails where subjectkey words are matched. I want to first export the emails to pst file and delete those exported email irrespective of subject Thanks Suresh
Free Windows Admin Tool Kit Click here and download it now
January 12th, 2009 7:53am

Hi, If you only want to delete some items, then you need to use filter like SubjectKeywords. If you want to retain some message items during the mailbox exporting, then you can archive those in one folder, and then specify value on IncludeFolders to export the specified folder. Export-Mailbox http://technet.microsoft.com/en-us/library/aa998579.aspx If that is not the case, then please feel free to let me know. Regards, Xiu
January 12th, 2009 10:03am

I just want to export the emails to pst file, then delete those exported emails. Hopethis message is very clear
Free Windows Admin Tool Kit Click here and download it now
January 12th, 2009 4:05pm

Hi, The main cause could be that Cdoex.dll version 8.1.278.2 is installed on the Microsoft Exchange Server 2007 server. You can check your Dll with Listdlls tool or you can check it from c:\program files\common Files\Microsoft Shared\CDO. I recommend you to apply rollup 4 and then check the issue. Update Rollup 4 for Exchange Server 2007 Service Pack 1 (KB952580) http://www.microsoft.com/downloads/details.aspx?FamilyId=8B492ED2-EA92-412F-A852-3AA1C58D9499&displaylang=en Description of Update Rollup 4 for Exchange Server 2007 Service Pack 1 http://support.microsoft.com/?kbid=952580 Besides, if you have large number of emails in the mailbox, more than 4000 items, then it will fail to delete. We can use Export-Mailbox -Identity user@domainname.com -PSTFolderPath C:\mypst.pst DeleteContent verbose debug to see if you would get error code -1056749164. More related information to share with you: 289999 OL2002: Error Messages When You Delete Large Number of Messages, http://support.microsoft.com/default.aspx?scid=kb;EN-US;289999 Regards, Xiu
January 13th, 2009 10:23am

Thanks for the detailed explanation, yes there is more than 4000 emails could be the reason. thanks
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2009 2:59pm

Hi,A hotfix is in the processing.The related kb number will be kb960367.But it is not published now. So please wait for the hotfix.Ifthis case isurgent for you,then you can contact CSS to get the hotfix now.Regards,Xiu
January 15th, 2009 5:39am

I have not run into the error but I have noticed something strange with the Export-Mailbox cmdlet. I ran my PS1 file and moved all email older than 6 months to a PST. worked like a champ - no errors. I also used -deletecontent. The files are gone from view and the size of the box has decreased.I then the next day accidentally ran the same file again and it ran as if no files were missing. In theroy if should have finished quickly because only one days worth of email was available. Any suggestions.
Free Windows Admin Tool Kit Click here and download it now
March 18th, 2009 11:31pm

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

Other recent topics Other recent topics