How to find Room Mailboxes by Keyword in Name Using PowerShell

How to find Room Mailboxes by Keyword in Name Using PowerShell

Introduction

If you manage Microsoft 365 or Exchange Online, you probably know how important Room Mailboxes are for scheduling meetings, reserving conference rooms, or managing shared resources. But what if you want to find all room mailboxes that have a specific keyword in their name—like ‘Meeting’, ‘Board’, or ‘Conference’? In this blog, we’ll walk you through a simple and effective PowerShell script that can help you do just that.

We’ll also break down each part of the script in simple, human language so you can fully understand what’s happening behind the scenes. This guide is SEO-optimized, easy to follow, and perfect for beginners and IT admins alike.

PowerShell Script to Get Room Mailboxes by Keyword

Here is the full PowerShell script to fetch all Room Mailboxes that contain a specific keyword in their name:

PowerShell
Get-Mailbox -ResultSize unlimited -RecipientTypeDetails RoomMailbox |<br>Where-Object { $_.Name -like "*SpecificKeyword*" } |<br>Select-Object DisplayName, PrimarySmtpAddress, Owner |<br>Export-CSV -NoTypeInformation -Path "C:\Users\Desktop\Information.csv"

Script Breakdown and Explanation

PowerShell
Get-Mailbox -ResultSize unlimited -RecipientTypeDetails RoomMailbox

This part fetches all mailboxes of the type ‘RoomMailbox’. Setting ResultSize to ‘unlimited’ ensures you get all available results without a cap.

PowerShell
Where-Object { $_.Name -like "*SpecificKeyword*" }

This filters the mailboxes to only those whose names contain the specific keyword you’re searching for. Replace ‘SpecificKeyword’ with your actual keyword.

PowerShell
Select-Object DisplayName, PrimarySmtpAddress, Owner

This selects the three important properties you want in the final report: the display name, the primary email address, and the owner of the mailbox.

PowerShell
Export-CSV -NoTypeInformation -Path "C:\Users\Desktop\Information.csv"

This exports the filtered list to a CSV file, which can be opened in Excel. The -NoTypeInformation flag makes the CSV cleaner by removing type metadata.

Expected Output

After running the script, you will get a file named ‘Information.csv’ saved on your desktop. This file will contain a list of all room mailboxes that matched your keyword, along with their display names, email addresses, and owner details.

Here’s an example of what the output might look like:

DisplayName            PrimarySmtpAddress           Owner
————————————————————–
Board Room A           boardroomA@yourdomain.com    Facilities Team
Conference Hall B      confhallB@yourdomain.com     Admin Department
Meeting Room 3rd Flr   meetroom3@yourdomain.com     Office Services

Conclusion

That’s it! With just a few lines of PowerShell, you can easily filter and extract Room Mailboxes containing specific keywords. This method is especially useful for IT admins managing large environments with dozens or even hundreds of resource mailboxes.

This guide not only helps you run the script but also understand it. If you’re working on Office 365 or Exchange Online, consider bookmarking this for future use.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *