Friday, December 27, 2013

Powershell Parse Outlook Inbox

I try to keep my inbox pretty clean. I only keep 30 days in my inbox before archival, try to setup rules to route and filter the noise, etc. I thought it would be cool to analyze the stats on my inbox. My inbox is pretty small compared to others, however there are some cool insights to gain from just 30 days of email. This process will work for larger inboxes as well.

I wrote a Script to parse Outlook Inbox. The output is a CSV file that you can use to analyze various things about your inbox. To Parse a folder in you inbox you can do this Using a BULK INSERT Script to load the data into SQL Server I was able to start generating some graphs. Here is a graph showing the top 20 senders to my email box. I left off the names to protect the guilty.

Top Senders

 Hour of day Breakdown

Busy email hours are 8am, 9am, 4pm etc.

Here is a word cloud of all the subject lines in my inbox (some stuff redacted)

VBScript Parse

With an update to Office some of my PowerShell code stopped working so I am adding the VBScript to parse Outlook as well.


  1. What does the value 6 signify for $olFolderInbox ?

  2. Just a constant. Could have easily just put a 6 in that getdefault folder call. 3 years later you look at your code again the variable name here helps you remember what 6 means.