Branden Frederick
Branden Frederick

Reputation: 71

How can you create Appointments (not meetings) in Outlook with Powershell?

I am trying to create Outlook Calendar appointments via a Powershell script. The below script works, it adds events to the calendar. But it adds an unsent Meeting Invitation to the calendar, not an Appointment. When I set the MeetingStatus to zero (or any other value besides 1) -- which is supposed to indicate a non-meeting event, aka an Appointment -- nothing gets added to the calendar.

$meeting = $ol.CreateItem('olAppointmentItem')
$meeting.Subject = 'New Years Day'
$meeting.Location = 'Office Closed'
$meeting.ReminderSet = $false
$meeting.MeetingStatus = 1
$meeting.Start = '1/1/2021 8:00:00 AM'
$meeting.Duration = 540
$meeting.BusyStatus = 3
$meeting.Categories = 'Holiday'
$meeting.Send()

Can someone please point out what I'm doing wrong?

Thank you

Upvotes: 4

Views: 4010

Answers (1)

Branden Frederick
Branden Frederick

Reputation: 71

A friend pointed out the solution, so I'll document it here for completeness:

I was using Send() but to save an appointment (MeetingStatus = 0) I need to instead use Save()

Made the change and it works like a charm.

Upvotes: 3

Related Questions