Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get latest appointments from outlook with powershell

I want to get the appointments for today and tomorrow of 3 different persons that are on my address book. These persons have the calendar shared on outlook.

How can I get this info with powershell? I don't mind getting the data from a local outlook instance but would prefer something connected directly to the server.

like image 713
Artur Carvalho Avatar asked Jan 19 '26 20:01

Artur Carvalho


1 Answers

You can start with this (local outlook instance), you may need to further filter the result based on some properties to find your friends information:

$olFolderCalendar = 9
$ol = New-Object -ComObject Outlook.Application
$ns = $ol.GetNamespace('MAPI')
$Start = (Get-Date).AddDays(-1).ToShortDateString()
$End = (Get-Date).ToShortDateString()

$Filter = "[MessageClass]='IPM.Appointment' AND [Start] > '$Start' AND [End] < '$End'"
$ns.GetDefaultFolder($olFolderCalendar).Items.Restrict($Filter) 
like image 168
Shay Levy Avatar answered Jan 21 '26 12:01

Shay Levy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!