Introduction
Creating resource room mailboxes in bulk can save IT admins a lot of time and hassle. This blog walks you through a step-by-step PowerShell script that automates the creation of multiple resource rooms from a CSV file in Exchange Online. Each part of the script is explained in a plain, human-friendly way—so even if you’re new to scripting, you’ll feel confident managing resource rooms like a pro.
Prerequisites
– Exchange Online PowerShell module installed
– You are connected to Exchange Online using: Connect-ExchangeOnline
– Your CSV should have columns: Name, Alias, EmailAddress
What Is a Resource Room Mailbox?
A resource room mailbox is a special kind of mailbox in Microsoft Exchange Online used to manage meeting rooms or shared spaces. These mailboxes allow users to reserve rooms directly from their Outlook calendar, making scheduling efficient and conflict-free.
PowerShell Script to Create Resource Rooms
Here’s the full PowerShell script:
$CSVFilePath = "C:\Users\Desktop\ResourceRoomsInformation.csv"
$ResourceRooms = Import-Csv $CSVFilePath
foreach ($room in $ResourceRooms) {
$ResourceRoomName = $room.Name
$ResourceRoomAlias = $room.Alias
$ResourceRoomEmailAddress = $room.EmailAddress
New-Mailbox -Name $ResourceRoomName -Alias $ResourceRoomAlias -Room -PrimarySmtpAddress $ResourceRoomEmailAddress
Set-CalendarProcessing -Identity $ResourceRoomEmailAddress -AddOrganizerToSubject $true -OrganizerInfo $true -DeleteAttachments $true -DeleteComments $false -DeleteSubject $true -RemovePrivateProperty $true
Set-CalendarProcessing $ResourceRoomEmailAddress -ConflictPercentageAllowed 50 -MaximumConflictInstances 3 -BookingWindowInDays 360
Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity $ResourceRoomEmailAddress":\Calendar" -User default
Write-Host "Resource room mailbox '$ResourceRoomName' with email address '$ResourceRoomEmailAddress' created successfully."
}
Explanation of Each Line in the Script
- $CSVFilePath:
This sets the path to your CSV file that contains all the room information.
- Import-Csv:
Reads the CSV file and stores each row as an object.
- foreach ($room in $ResourceRooms):
Loops through each room entry in the CSV file.
- $room.Name / Alias / EmailAddress:
These extract the Name, Alias, and Email Address from each row.
- New-Mailbox -Room:
Creates a new resource room mailbox with the specified name, alias, and primary email.
- Set-CalendarProcessing:
This configures how meeting requests are processed.
- Set-MailboxFolderPermission:
Grants default (everyone) limited calendar view permissions.
- Write-Host:
Displays a success message in the PowerShell console.
Sample CSV File Format
Make sure your CSV looks like this:
Name,Alias,EmailAddress
Room A,RoomA,rooma@domain.com
Room B,RoomB,roomb@domain.com
Example Output from Script
When you run the script successfully, you’ll see output like this:
Resource room mailbox ‘Room A’ with email address ‘rooma@domain.com’ created successfully.
Resource room mailbox ‘Room B’ with email address ‘roomb@domain.com’ created successfully.
Final Thoughts
Using PowerShell to manage Exchange Online resources can save time and reduce human error. With this script, you can bulk-create and configure resource room mailboxes efficiently. Just make sure your CSV is accurate, and you’ll be all set to automate with confidence!