I trying to export a mailbox (of any user) from a Exchange 2010 Server to a PST file. What is the best way to archive this?
First I was looking at the COM-Interop model. But this seems just to be able to export the Mailbox of the user that is currently logged in into Outlook. Or am I missing something there? I tried this:
Dim app As New Outlook.Application()
Dim ns As Outlook.NameSpace = app.GetNamespace("MAPI")
ns.AddStore("C:\backup.pst")
Dim backupFolder As Outlook.MAPIFolder = ns.Session.Folders.GetLast()
Dim selectedMailBox As Outlook.MAPIFolder = ns.Folders("[email protected]") 'NOT Working
selectedMailBox.CopyTo(backupFolder)
ns.RemoveStore(backupFolder)
Later I found this PowerShell function: New-MailboxExportRequest
Sadly I can't find a way to call this from .NET. Is there any possibility to call it from .NET?
Or do I need to use any other library to export files from Exchange? (Maybe use POP3 to get all Mails and convert them to PST?)