Dumping Exchange online mailbox contents RRS feed

  • Question

  • Hi,

    I need to work on 2 programming tasks related to exchange online mailboxes. 

    1. To show list of mailboxes using either Remote PowerShell  or may be EWS.

    2. Dump the contents of an exchange onine mailbox to a local .pst file

    I m talking about Exchange Online (not Office365 which is new form of Exchange online. MS have stopped selling Exchange Online.)

    I know how to use EWS with exchange online (read this article too, and also have worked with Remote powerShell, but dont know whether I can complete above mentioned tasks with Exchange online using Remote PS or EWS.

    Any help or link would be highly appreciated.

    Regards, David Johnson
    • Edited by Cyber Friend Monday, December 5, 2011 8:57 PM modify
    Monday, December 5, 2011 1:15 PM

All replies

  • 2. PST and MSG are both Office(Outlook) file formats (eg a msg file is a compond OLE document) so to export a mailbox to a PST file you need to use MAPI either extended Mapi or you could use the OOM or possibly a third party library like Redemption if you need a level of automation. There is also the PST SDK on codeplex which may help. The only format that EWS supports for exporting is its own opaque datablob that is supported for reimpoting

    1. To show a list of Mailboxes your better of using Remote powershell and Get-Mailbox eg against Office365 the following should work

                    ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
                    String AdminUserName = "UserName";
                    String Password = "Password";
                    System.Security.SecureString secureString = new System.Security.SecureString();
                    foreach (char c in Password)
                    PSCredential credential = new PSCredential(AdminUserName, secureString);
                    WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri(""), "", credential);
                    connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Basic;
                    connectionInfo.SkipCACheck = true;
                    connectionInfo.SkipCNCheck = true;
                    connectionInfo.MaximumConnectionRedirectionCount = 4;
                    Runspace runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(connectionInfo);
                    // Make a Get-Mailbox Request
                    Command grGetMailbox = new Command("Get-Mailbox");
                    grGetMailbox.Parameters.Add("ResultSize", "Unlimited");
                    Pipeline plPileLine = runspace.CreatePipeline();
                    Collection<PSObject> RsResultsresults = plPileLine.Invoke();
                    foreach (PSObject obj in RsResultsresults)


    Tuesday, December 6, 2011 2:35 AM