Forum Discussion
Skylar2000
Jan 25, 2021Copper Contributor
How to Export all Messages from MS Outlook into CSV file using PowerShell?
Hi Guys, How are you guys doing today? I am still new to Powershell and keep on learning it every day. I need some helps here, I need to export all MS Outlook messages to CSV files. I know this i...
Aleksandr_Reznik
Jun 18, 2022Copper Contributor
You can try changing $ExportOutlookMessage = $OutlookFolder.Folders.items to $ExportOutlookMessage = $OutlookFolder.items
I also recommend to install Visual Studio Code and run powershell from it. You can add a breakpoint at place you need and after the program will pause on breakpoint review variable values in Watch window.
Example of working program which exports mails from Outlook to CSV: https://it4it.solutions/2022/06/13/exporting-mails-from-microsoft-outlook-to-csv-file-with-powershell/ - it lists folders recursively with number of items first, then it export emails from defined set of folders to single CSV file (subfolders included).