0

We have a use case here to extract a .pst file of a given user using MS Graph API. we are able to do it through PowerShell commands provided by MS. but now want to move away from PS scripts and create a solution using Java/Python. But, unfortunately, I don't see any APIs available from Microsoft to do a mailbox extraction. These extractions are mostly for O365 mailboxes.

Looking something equivalent to this command - https://learn.microsoft.com/en-us/powershell/module/exchange/new-mailboxexportrequest?view=exchange-ps

Any guidance or pointers here to any documentation will be much appreciated!!

Raj
  • 125
  • 3
  • 17

1 Answers1

0

There is nothing PST specific in Graph or EWS. It is a purely client side file format. There are some libraries that lets you access PST files, but your mileage will vary greatly.

You can create a PST file using Extended MAPI (you will need to add/edit a profile and add/configure the MSUPST MAPI service), but that requires C++ or Delphi. If using Redemption is an option (it supports any language including Python, I am its author), it will let you create a PST file using RDOSession.LogonPstStore. You can then create folders and messages in the PST file, and import data (RDOMail.Import) in just about any format, including MIME. If you are working with Exchange, it will let you work with the Fast Transfer Stream format - it is native to Exchange (use ExportItem EWS operation) and, unlike MIME, preserves all MAPI-specific properties.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78