Get task entries via PowerShell

Requirements: Basic PowerShell knowhow and Outlook Application.

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

Use case

This Outlook API can be used to migrate or evaluate the task data inside of an Outlook mapped mailbox. This data can be valuable, for example, when project evaluation should be made based on data from tasks.

Custom task list entries

This PowerShell code gets all entries from a new custom task list of the users mailbox.

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

Default task list entries

This PowerShell code gets all entries from the default task list of the users mailbox.

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

Revision #5
Created 26 December 2022 00:26:29 by Luca Noah Caprez
Updated 26 December 2022 22:19:01 by Luca Noah Caprez