Export a mail as PST file using EWS API

Hi,

I need to export the Exchange mails to PST file without installing the outlook. To acheive this i am choosing the EWS API. but i dont know how to do that. So, now i have a two questions, the first one, is it possible to create the pst file using EWS API?. If yes, how to create a pst file using EWS, if any one posted the sample code here, it is very helpful for me.

Thanks,
RamMohan

February 16th, 2015 3:20am

Hi,

I think it would be easier to do this with PowerShell and the Export-Mailbox cmdlet: https://technet.microsoft.com/en-us/library/bb266964%28EXCHG.80%29.aspx


Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 3:28am

Hi Adam,

Thanks for your quick response, Yes, But i thought this is work with Exchange server installed machine alone. not with any other machines, like Desktop machine and server machine without installing the Exchange server. 

Here i will give some small description about my project, I am parsing the mails from the exchange EDB files(The edb, may be in Exchange server machine or any one of desktop machine) and then i want export the mail which is getting from edb file in to a pst file. I hope now you are understand my requirement.

Thanks,
RamMohan
February 16th, 2015 3:44am

Hi Ram,

This technet library looks a good approach to understand and resolve your concern in depth : https://msdn.microsoft.com/en-us/library/office/dn672316%28v=exchg.150%29.aspx

Moreover, if you wish, you may also consider on this automated solution (http://www.exchangemailboxtopst.org/) while need to import or export edb items into pst.

Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 5:11am

Hi,

I think it would be easier to do this with PowerShell and the Export-Mailbox cmdlet: https://technet.microsoft.com/en-us/library/bb266964%28EXCHG.80%29.aspx


February 16th, 2015 11:26am

Hi,

I think it would be easier to do this with PowerShell and the Export-Mailbox cmdlet: https://technet.microsoft.com/en-us/library/bb266964%28EXCHG.80%29.aspx


Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 11:26am

Hi,

I think it would be easier to do this with PowerShell and the Export-Mailbox cmdlet: https://technet.microsoft.com/en-us/library/bb266964%28EXCHG.80%29.aspx


February 16th, 2015 11:26am

EWS is not going to help you do what your trying to do, EWS is an Exchange API so you need to have an Exchange 2007 server or greater with the MailStore mounted to even use it to access the Mailbox . EWS also doesn't support exporting email to a PST because the PST file is an Office file format so in the case where you do manage to mount the database on Exchange then use Adam's suggestion or just connect via Outlook and export the Mailbox.

>> I am parsing the mails from the exchange EDB files

 With what ? reading the contents of an EDB file directly is not supported although there are a few third party apps that can do it and if your using one of those apps then all of them I've seen support the export to PST (unless your using a Trial licence).  The correct method of recovering data from an EDB file would be to use a Recovery Database https://technet.microsoft.com/en-us/library/dd876954(v=exchg.150).aspx even if you don't have access to the environment you should be able to setup a temp environment using Virtual machines and recover it that way.

Cheers
Glen

 

Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 7:49pm



Hi Ronny,

Thanks for your info. I checked with the given link, but in that also have some dependencies to export the mails to other formats. I need to export without any dependencies. Any way thanks for your time and help.

Please let me know, if myself understand in wrong manner.

Thanks,
P.RamMohan

February 17th, 2015 1:24am

Hi Glen,

I am parsing the edb file using ese.dll and also i can able to export the mails to pst files. For export as a pst file i am using a MAPI tool. But to export this i need to install the outlook in my machine. To eliminate this dependencies, i planned to move EWS API from MAPI. Please correct me, if any thing wrong.


Thanks,
P.RamMohan
Free Windows Admin Tool Kit Click here and download it now
February 17th, 2015 1:40am

 EWS stands for Exchange Web Services so its a Web Service that runs on a Exchange Server (particular the CAS Server role). I think your getting confused with the EWS Managed API which is just a client side library to access the Web Service either way they can't be used in isolation (without Exchange) so its useless for what your trying to do. The only two PST providers I know of are Outlook or the Standalone MAPI client http://www.microsoft.com/en-au/download/details.aspx?id=1004 however the standalone MAPI client doesn't support Unicode PST or MSG files (so limited to 2GB max) . There is https://pstsdk.codeplex.com/documentation but it's really incomplete. My suggestion is you leave Outlook as a dependency as its has the most complete and reliable PST provider.

Cheers
Glen

February 17th, 2015 10:05pm

Hi Ram

You have got to know that EWS is not going to help you in this case ,and as you told you have not installed Exchange Server, so  Powershell cmdlets are useless to you. Here in this situation, you can use any professional tool to export Exchange mails to PST.

You may find some help here at : http://bit.ly/17uf0gZ 

Free Windows Admin Tool Kit Click here and download it now
February 19th, 2015 5:35am

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

Other recent topics Other recent topics