Skip to content

Instantly share code, notes, and snippets.

@ghotz
Created July 1, 2014 11:51
Show Gist options
  • Save ghotz/8b4c542254c5d440c1cd to your computer and use it in GitHub Desktop.
Save ghotz/8b4c542254c5d440c1cd to your computer and use it in GitHub Desktop.
Get Internet Headers from Outlook MailItem
# Get Iternet headers from MailItem in PowerShell
Add-type -assembly "Microsoft.Office.Interop.Outlook" | out-null
$OutlookApp = new-object -comobject outlook.application
$MAPI = $OutlookApp.GetNamespace("MAPI")
$Message = $MAPI.GetDefaultFolder([Microsoft.Office.Interop.Outlook.OlDefaultFolders]::olFolderInbox).Items.GetFirst();
# http://msdn.microsoft.com/en-us/library/ms530451.aspx
$Message.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x007D001E")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment