- April 24, 2017 at 7:50 pm #513
A common exercise for any script writer that works with email is to export data from a mailbox.
PowerMapi makes this work easy and such can be done from any source where mapi is used.
This example will take the common use-case of exporting data from a mailbox in Microsoft Exchange to a PST file.
$sess = New-MapiSession outlook-main
$sourceStore = get-mapistore $sess -GetPrimaryStore
$sourceRootFolder = Get-MapiFolder $sourceStore -CommonFolder IPMSubtree
$pstStore = Open-MapiPST -PstFilePath c:\temp\out.pst -Session $sess -CreateNew
$pstRootFolder = Get-MapiFolder $pstStore -CommonFolder IPMSubtree
Copy-MapiFolder -SourceFolder $sourceRootFolder -DestinationFolder $pstRootFolder -CopySubfolders
The above should be self-explanatory. Additional script work could be done to track how much data is being copied into the target (to avoid exceeding the PST file size limit, for example) or to exclude folders or items. There are cmdlets to search and filter items that can make the above more capable.
You must be logged in to reply to this topic.