Submitted By: Kent Finkle

Lists all Microsoft Outlook appointments scheduled in December, 2007.

PowerShell
Edit|Remove
$comments = @' 
Script name: List-Appointments.ps1 
Created on: Tuesday, August 28, 2007 
Author: Kent Finkle 
Purpose: How can I use Windows Powershell to 
Get a List of Appointments for a Specific Month? 
'@ 
$olFolderCalendar = 9 
 
$o = new-object -comobject outlook.application 
$n = $o.GetNamespace("MAPI") 

$f = $n.GetDefaultFolder($olFolderCalendar) 
 
$Items = $f.Items 
 
$Filter = "[Start] >= '12/1/2007' AND [Start] <= '12/31/2007'" 
$Filtered = $Items.Restrict($Filter) 
 
foreach ($Item In $Filtered) { 
    If ($Item.Start -gt (get-date)) { 
        Write-Host("Meeting name: " + $Item.Subject) 
        Write-Host("Meeting date: " + $Item.Start) 
        Write-Host("Duration: " + $Item.Duration + " minutes") 
        Write-Host("Location: " + $Item.Location) 
        Write-Host 
    } 
}