PowerShell and Outlook

This script was written by ed wilson at Use PowerShell to Data Mine Your Outlook Inbox

CLEAR

Function Get-OutlookInBox {
 Add-type -assembly "Microsoft.Office.Interop.Outlook" | out-null
 $olFolders = "Microsoft.Office.Interop.Outlook.olDefaultFolders" -as [type]
 
 $outlook = new-object -comobject outlook.application
 $namespace = $outlook.GetNameSpace("MAPI")
 $folder = ($namespace.getDefaultFolder($olFolders::olFolderInBox)).folders|WHERE {$_.Name -eq "DDUMP"}
 $folder.items | Select-Object -Property Subject, ReceivedTime, Importance, SenderName
} #end function Get-OutlookInbox

Get-OutlookInBox |where { $_.ReceivedTime -gt [datetime]"6/25/12"} | sort importance