@@ -53,13 +53,54 @@ Function Invoke-EditRoomMailbox {
5353 }
5454 }
5555
56+
57+ # Then update the calendar properties
58+ $UpdateCalendarParams = @ {
59+ Identity = $MailboxObject.roomId
60+ }
61+
62+ $CalendarProperties = @ (
63+ ' AllowConflicts' , ' AllowRecurringMeetings' , ' BookingWindowInDays' ,
64+ ' MaximumDurationInMinutes' , ' ProcessExternalMeetingMessages' , ' EnforceCapacity' ,
65+ ' ForwardRequestsToDelegates' , ' ScheduleOnlyDuringWorkHours ' , ' AutomateProcessing'
66+ )
67+
68+ foreach ($prop in $CalendarProperties ) {
69+ if (! [string ]::IsNullOrWhiteSpace($MailboxObject .$prop )) {
70+ $UpdateCalendarParams [$prop ] = $MailboxObject .$prop
71+ }
72+ }
73+
74+ # Then update the calendar configuration
75+ $UpdateCalendarConfigParams = @ {
76+ Identity = $MailboxObject.roomId
77+ }
78+
79+ $CalendarConfiguration = @ (
80+ ' WorkDays' , ' WorkHoursStartTime' , ' WorkHoursEndTime' , ' WorkingHoursTimeZone'
81+ )
82+
83+ foreach ($prop in $CalendarConfiguration ) {
84+ if (! [string ]::IsNullOrWhiteSpace($MailboxObject .$prop )) {
85+ $UpdateCalendarConfigParams [$prop ] = $MailboxObject .$prop
86+ }
87+ }
88+
5689 try {
5790 # Update mailbox properties
5891 $null = New-ExoRequest - tenantid $Tenant - cmdlet ' Set-Mailbox' - cmdParams $UpdateMailboxParams
5992
6093 # Update place properties
6194 $null = New-ExoRequest - tenantid $Tenant - cmdlet ' Set-Place' - cmdParams $UpdatePlaceParams
62- $Results.Add (" Successfully updated room: $ ( $MailboxObject.DisplayName ) " )
95+ $Results.Add (" Successfully updated room: $ ( $MailboxObject.DisplayName ) (Place Properties)" )
96+
97+ # Update calendar properties
98+ $null = New-ExoRequest - tenantid $Tenant - cmdlet ' Set-CalendarProcessing' - cmdParams $UpdateCalendarParams
99+ $Results.Add (" Successfully updated room: $ ( $MailboxObject.DisplayName ) (Calendar Properties)" )
100+
101+ # Update calendar configuration properties
102+ $null = New-ExoRequest - tenantid $Tenant - cmdlet ' Set-MailboxCalendarConfiguration' - cmdParams $UpdateCalendarConfigParams
103+ $Results.Add (" Successfully updated room: $ ( $MailboxObject.DisplayName ) (Calendar Configuration)" )
63104
64105 Write-LogMessage - headers $Request.Headers - API $APIName - tenant $Tenant - message " Updated room $ ( $MailboxObject.DisplayName ) " - Sev ' Info'
65106 $StatusCode = [HttpStatusCode ]::OK
0 commit comments