Exchange Rooms Resources mailbox & Powershell

Use powershell to change the calendar processing settings of resources mailbox (MS Teams Rooms).




First you need to connect to Exchange Online

Connect-ExchangeOnline

To get a list of all Resource/Room Mailboxes

Get-Mailbox -ResultSize unlimited -Filter "RecipientTypeDetails -eq 'RoomMailbox'"

If you want to find out the Booking Windows and Maximum Duration settings for one or all mailboxes

#one mailbox
Get-Mailbox <mailbox> |Get-CalendarProcessing | FL Identity,BookingWindowInDays,MaximumDurationInMinutes

#all mailboxes
Get-Mailbox -ResultSize unlimited -Filter "RecipientTypeDetails -eq 'RoomMailbox'" | Get-CalendarProcessing | FL Identity,BookingWindowInDays, MaximumDurationInMinutes, -EnforceSchedulingHorizon > c:\temp\room-cal-processing.csv

If you want to change these settings for one or all mailboxes :

#change BookingWindow and Max duration for one mailbox
Get-Mailbox <mailbox> |Set-CalendarProcessing -BookingWindowInDays 365 -MaximumDurationInMinutes 1440

#change BookingWindow and Max duration for all resource mailboxes
Get-Mailbox -ResultSize unlimited -Filter "RecipientTypeDetails -eq 'RoomMailbox'" | Set-CalendarProcessing -BookingWindowInDays 365 -MaximumDurationInMinutes 1440 -EnforceSchedulingHorizon $true

Get all the settings for one mailbox

Get-Mailbox <mailbox> |Fl

Get-Mailbox -ResultSize unlimited -Filter “RecipientTypeDetails -eq ‘RoomMailbox'” | Get-CalendarProcessing | FL Identity,BookingWindowInDays, MaximumDurationInMinutes > c:\temp\room-cal.csv

Some other useful Powershells

# Creating Room (Resource) Mailbox
New-Mailbox -Name "<Identity>" -Room

# Create new Equipment Mailbox
New-Mailbox -Name "<Name>" -Equipment

# Enable automatic booking (calendar processing)
Set-CalendarProcessing "<Identity>" -AutomateProcessing AutoAccept

#Enable Automatic Booking for all Resource Mailboxes
 Get-MailBox | Where {$_.ResourceType -eq "Room"} | Set-CalendarProcessing -AutomateProcessing:AutoAccept 
or 
 Get-Mailbox -ResultSize unlimited -Filter "RecipientTypeDetails -eq 'RoomMailbox'" | Set-CalendarProcessing -AutomateProcessing:AutoAccept

# Assign Room Mailbox Manager Full Access permission
Add-MailBoxPermission "<Identity>" -User "<Identity>" -AccessRights FullAccess

# Assign approving delegate (Room Mailbox Calendar)
Set-CalendarProcessing "<Identity>" –ResourceDelegates "<Identity>" 

# Assign Room Mailbox Manager -Assigning Send As permission
Add-RecipientPermission "<Identity>" -Trustee "<Identity>" -AccessRights SendAs -Confirm:$False

# Allow conflict meetings when using the option of Automatic Booking
Set-CalendarProcessing "<Room name>"  -AllowConflicts $True

#Set the default permission of Calendar to: Publishing Editor
Set-MailBoxFolderPermission "<Room:\Calendar>" –User default –AccessRights PublishingEditor

# Display list of Room Mailboxes
Get-Mailbox -Filter '(RecipientTypeDetails -eq "RoomMailBox")' | Select Name,Alias

# Display list of Equipment Mailboxes
Get-Mailbox -Filter '(RecipientTypeDetails -eq "quipmentMailBox")' | Select Name,Alias

#Display Room MailBox : Calendar Processing Settings
Get-Mailbox "<Identity>"  | Get-CalendarProcessing | FL

#Display calendar settings
Get-Mailbox "<Identity>"  | Select ResourceType, RejectMessagesFrom,RejectMessagesFromDLMembers,RejectMessagesFromSendersOrMembers,SendModerationNotifications

#Display Room Mailbox Permissions: Moderated By
Get-Mailbox <Room Name> | FT -Property ModerationEnabled ,ModeratedBy,GrantSendOnBehalfTo –AutoSize

#Display Room Mailbox : Calendar Permission
Get-MailBoxFolderPermission  <Room:\Calendar>  | Select FolderName,User,AccessRights

#Set the Room Calendar to show ‘limited details’
Set-MailBoxFolderPermission -AccessRights LimitedDetails  <Room:\Calendar> -User default

#Set the Room Calendar to show the ‘Organizer’ and ‘Subject’ of the meeting
Set-CalendarProcessing <Room Name> -AddOrganizerToSubject $True -DeleteComments $False -DeleteSubject $False

#Convert reglar to room
Set-Mailbox  <Identity> -Type Room
# convert to regular
Get-Mailbox <Room:\Calendar> | Set-Mailbox -Type Regular

More information : Manage resource mailboxes in Exchange Online | Microsoft Learn

Leave a Reply

Your email address will not be published.