Skip to main content

Get task entries via PowerShell

Requirements: Basic PowerShell knowhow and Outlook Application.

This documentation shows how to read calendartask data from an Outlook attached mailbox in PowerShell.

Use case

This Outlook API can be used to migrate or evaluate the calendartask data inside of an Outlook mapped mailbox. This data can be valuable, for example, when timeproject evaluationsevaluation should be made usingbased theon calendar.data from tasks.

Custom Exchange calendar entries

This PowerShell code gets all entries from a new custom calendartask list of the Exchangeusers mailbox.

$UPN = "<upnofmailboxuser>"
$Calendarname = "<calendarname>"
$ol = New-Object -comobject Outlook.Application
$ns = $ol.GetNamespace('MAPI')
$folder = $ns.Folders.Item("$UPN").Folders.Item('Calendar'Tasks').Folders.Item($Calendarname)
$AllItems = $folder.items |  Select-Object -Property Subject, Start, Duration

Default Exchange calendar entries

This PowerShell code gets all entries from the default calendartask list of the Exchangeusers mailbox.

$UPN = "<upnofmailboxuser>"
$Calendarname = "<calendarname>"
$ol = New-Object -comobject Outlook.Application
$ns = $ol.GetNamespace('MAPI')
$folder = $ns.Folders.Item("$UPN").Folders.Item('Calendar'tasks')
$AllItems = $folder.items |  Select-Object -Property Subject, Start, Duration