Hello,
Using COM access via PowerShell, I want to retrieve certain properties from Outlook folder items. The folder is a shared Exchange folder that has been synchronized in offline mode and outlook is put offline (should be no server access). I use this query, where $pt is MAPIFolder
$ol = new-object -comobject "Outlook.Application"
$mapi = $ol.getnamespace("mapi")
$inbox = $mapi.Folder /* skipped*/
$pt.items|select-object Subject, Sendername, SentOn,Recipients,ConversationIndex,ConversationTopic,CC,Bcc,ReceivedTime|export-csv -path pentest.csv -noTypeInformation
The folder has a couple thousand entries and this query does not complete overnight and PowerShell+Outlook chew all CPU resources. By obvserving the output pace, it appears to output a dozen entires then stall, then output, stall, ad nausea.
How to speed it up? My ultimate goal is to do import it into some kind of SQL, hence the export to CSV.