Create Microsoft Teams Room account using PowerShell

by | Mar 2, 2021 | Microsoft 365 | 0 comments

A short manual on how to create a Microsoft Teams Room account using the PowerShell

Due to requirements for further posts, I needed to create a new Teams Room Account. But what is this account?

Documentations says:

The account is used to access its meeting calendar and establish Microsoft Teams or Skype for Business connectivity. People can book this account by scheduling a meeting with it. Microsoft Teams Rooms will be able to join that meeting and provide various features to the meeting attendees.

Source: [https://docs.microsoft.com/en-us/MicrosoftTeams/rooms/rooms-configure-accounts]

To use MTR we need specific licenses. We can use a dedicated license with SKU: Meeting Room or Meeting Room Premium. Those licenses have inside:

  • Skype for Business
  • Microsoft Teams
  • Phone System
  • Audio conferencing
  • Microsoft Intune

Because I have only Microsoft 365 developer tenant, I’m not able to assign an Audio conferencing license, so I will create a new group without this SKU.

First, I will create a new dynamic group where I will be store all of my users. Configuration options which I want to set up:

  • Type of membership: Dynamic User
  • query to get members: (user.displayName -contains “MTR”)

This query will add automatically all of the users which have “MTR” on the displayname. For example, if you create a new account for your new device, this account will automatically have proper licenses assigned to your account. But please remember – in this case, your new account should have MTR on displayname.

After that, I will assign proper licenses to this group (those which I created earlier)

Create Microsoft Teams Room account using PowerShell

In the next step, I will create a new room using PowerShell. From my perspective, it is much faster than using GUI.

Below you will find a whole script, with comments (I’m using an account with MFA enabled)

install-module ExchangeOnlineManagement #installing module
Connect-ExchangeOnline -UserPrincipalName [yourAdminAccount] #logging in to Exchange module

New-Mailbox -Name "MTR01" -Alias MeetingRoom1 -Room -EnableRoomMailboxAccount $true -MicrosoftOnlineServicesID [email protected] -RoomMailboxPassword (ConvertTo-SecureString -String 'OurPasswordForConferenceRoom' -AsPlainText -Force) #creating a new account. Remember to change your password!

#after some time your account will be created
Set-CalendarProcessing -Identity "MTR01" -AutomateProcessing AutoAccept -AddOrganizerToSubject $false -DeleteComments $false -DeleteSubject $false -RemovePrivateProperty $false -AddAdditionalResponse $true -AdditionalResponse "Your meeting was scheduled. In any of questions, please contact with HelpDesk team." #Now we are setting up to automatically accept invites and set providing automatically reply with information that meeting was scheduled etc...

install-module msonline #here we are installing the old module for the Azure Active directory.
Connect-MsolService #connect with our admin account
Set-MsolUser -UserPrincipalName [email protected] -PasswordNeverExpires $true #set password to never expire

Start-Sleep 300 #here we are pause script for 5 minutes to populate licenses

#next we will install module to have a possibilty to use Microsoft Teams with PowerShell
Install-Module MicrosoftTeams
$teams = New-CsOnlineSession #connect to teams admin
Import-PSSession $teams #import session
$availablePool = Get-CsOnlineUser | Select-Object RegistrarPool| Get-Unique #get all RegistrarPool which is needen on the next step
Enable-CsMeetingRoom -Identity "[email protected]" -RegistrarPool $availablePool -SipAddressType EmailAddress

As you can see, this script can be difficult to use, but only on the first time when you need to install all of the modules. After that, I think it will be much easier to use.

Finally, our account will be visible on Microsoft 365 Admin Center > Resources > Rooms

Create Microsoft Teams Room account using PowerShell

In this post it is everything. We created a new MTR account and we can use it on our devices.

One piece of information about the script which I wrote. I’m using the old module MSonline, but to set password policy you can also use the new module AzureAD.

Set-AzureADUser -objectID [IDOfOboject] -PasswordPolicies DisablePasswordExpiration

So you don’t need to install the old module. You can use the new one! 🙂

Jakub Piesik

Jakub Piesik

Microsoft 365 Consultant

I’m writing not only about Intune and Windows 365. I’m writing about everything what I leared previously and want to share with you!

#security #microsoft365 #intune #windows365 #powershell #automation 🙂