Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 1.7 KB

README.md

File metadata and controls

26 lines (21 loc) · 1.7 KB

ExtractMsgContent

This PowerShell script extracts content from *.msg files and Active Directory, then writes that data to a CSV output file

Overview

  1. The script will iterate over msg files in a specified folder, defined by $msgPath
  2. Outlook must be closed… the script uses Outlook via a com object
  3. It creates a csv file with a randomly-generated filename in the source path to store information about each msg file
  4. The main script loops over each msg file in the source, extracting specific data from the message header
  5. The main script queries Active Directory for specific information about a user, and returns it in the $account variable
  6. Each set of information is added to an array as an object. Array = @() Object = @{}
  7. When the loop is complete, the script attempts to force close Outlook
  8. The array hash is exported to a .csv file

Sources