Whilst you could manually add all the folders to an XLSX file, this script makes it quicker and easier. You just provide a list of folders to examine and it will find all the sub-folders that contain either .MGS or .EML files and will add them to a CSV. It is provided as three files:


  1. A sample folders.txt which you can edit to list the root folders that you want to scan
  2. ExportMsgFolder.ps1 which is the PowerShell script
  3. CreateCSV.bat which is a batch file that launches the PowerShell for you


The files are provided in this zip: CreateCSVs.zip


All you need to do is edit the folders.txt, save it and then double-click the CreateCSV.bat to run the script.


It will create one CSV file for each folder that you have listed and will name it using the last folder name in the path.


Be sure to convert these to XLSX by opening them in Excel and then saving as XLSX.


You now have a spreadsheet of paths which you can edit with Excel's search & replace to create the two columns for Location name and Path.


You can then use the Bulk Importer's XLSX method to import the locations.