Skip to content

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

Notifications You must be signed in to change notification settings

RayDeanTech/powershell-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published