Created
July 1, 2014 11:51
-
-
Save ghotz/8b4c542254c5d440c1cd to your computer and use it in GitHub Desktop.
Get Internet Headers from Outlook MailItem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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