Retrieving Outlook Calendar Entries

by Oct 15, 2018

If you use Outlook to organize your calendar events, here is a useful PowerShell function that connects to Outlook and dumps your calendar entries:

Function Get-OutlookCalendar
{
    # load the required .NET types
    Add-Type -AssemblyName 'Microsoft.Office.Interop.Outlook'
    
    # access Outlook object model
    $outlook = New-Object -ComObject outlook.application

    # connect to the appropriate location
    $namespace = $outlook.GetNameSpace('MAPI')
    $Calendar = [Microsoft.Office.Interop.Outlook.OlDefaultFolders]::olFolderCalendar
    $folder = $namespace.getDefaultFolder($Calendar)
    # get calendar items
    $folder.items |
      Select-Object -Property Start, Categories, Subject, IsRecurring, Organizer
}

Try this:

 
PS> Get-OutlookCalendar | Out-GridView
 

Twitter This Tip! ReTweet this Tip!