{"id":530,"date":"2026-01-28T23:29:52","date_gmt":"2026-01-28T23:29:52","guid":{"rendered":"https:\/\/xuan.co.uk\/?p=530"},"modified":"2026-01-28T23:29:52","modified_gmt":"2026-01-28T23:29:52","slug":"powershell-to-export-all-outlook-emails-as-individual-msg-files-with-attachments","status":"publish","type":"post","link":"https:\/\/xuan.co.uk\/?p=530","title":{"rendered":"Powershell to export all Outlook emails as individual MSG files with attachments"},"content":{"rendered":"<p>The script presents a dialog box to choose the outlook folder to export as individual messages including attachments and replicates folder structure.<\/p>\n<p>The filename of the email is saved as:<\/p>\n<p>Outlook_foldername-dateYYMMDD-Time-SenderName-EmailSubject.msg<\/p>\n<p>Attachments are saved with the same filename appending the attachment filename eg:<\/p>\n<p>Outlook_foldername-dateYYMMDD-Time-SenderName-EmailSubject-attachment_name.extension<\/p>\n<p><strong>How to use:<\/strong><\/p>\n<p>Edit the script line &#8220;# Configuration&#8221; to change where the MSG files will be saved into.<\/p>\n<p># Configuration<br \/>\n$ExportPath = &#8220;C:\\OutlookExport&#8221;<\/p>\n<p>Run PowerShell as administrator.<\/p>\n<p>Ensure your PowerShell execution policy allows scripts type and agree with the prompt:<\/p>\n<p>Set-ExecutionPolicy -ExecutionPolicy RemoteSigned<\/p>\n<p>run the script and choose the outlook folder to extract, it will be recursive.<\/p>\n<p><a href=\"https:\/\/xuan.co.uk\/wp-content\/uploads\/2026\/01\/outlook2msg.zip\">DOWNLOAD outlook2msg<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The script presents a dialog box to choose the outlook folder to export as individual messages including attachments and replicates folder structure. The filename of the email is saved as: Outlook_foldername-dateYYMMDD-Time-SenderName-EmailSubject.msg Attachments are saved with the same filename appending the attachment filename eg: Outlook_foldername-dateYYMMDD-Time-SenderName-EmailSubject-attachment_name.extension How to use: Edit the script <a class=\"more-link\" href=\"https:\/\/xuan.co.uk\/?p=530\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-530","post","type-post","status-publish","format-standard","hentry","category-tech-tips"],"_links":{"self":[{"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=530"}],"version-history":[{"count":1,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/530\/revisions"}],"predecessor-version":[{"id":532,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/530\/revisions\/532"}],"wp:attachment":[{"href":"https:\/\/xuan.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xuan.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}