@@ -53,13 +53,54 @@ Function Invoke-EditRoomMailbox {
53
53
}
54
54
}
55
55
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
+
56
89
try {
57
90
# Update mailbox properties
58
91
$null = New-ExoRequest - tenantid $Tenant - cmdlet ' Set-Mailbox' - cmdParams $UpdateMailboxParams
59
92
60
93
# Update place properties
61
94
$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)" )
63
104
64
105
Write-LogMessage - headers $Request.Headers - API $APIName - tenant $Tenant - message " Updated room $ ( $MailboxObject.DisplayName ) " - Sev ' Info'
65
106
$StatusCode = [HttpStatusCode ]::OK
0 commit comments