
Prerequisites:
Up-to-date Powershell application
Exchange Online Management module for Powershell (EXO V2)
Microsoft Teams Room License (Pro ***Standard and Premium licenses are now Legacy***)
Install-Module PowershellGet -ForceUpdate-Module PowershellGetSet-ExecutionPolicy RemoteSignedInstall-Module -Name ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement
Connect-ExchangeOnline
Connect-MsolService
Install-Module MicrosoftTeams
Connect-MicrosoftTeams
Get-MsolAccountSKU
Install-module microsoftteams // If you haven't install this module. It's only required if it's the first time you connecting to it//
Connect-microsoftteams // You will be required to enter you credentials. Make sure you use an account that has Teams administrator privileges//
Get-MsolAccountSku // This command will return available licenses SKU available under your account //
$NewRoom="[EmailAddress]"
$Name="[DisplayName]"
$pwd="[YourPassword]"
$location="CA"
$license="[LicenseName]"
New-Mailbox -MicrosoftOnlineServicesID $newRoom -Name $name -Room -RoomMailboxPassword (ConvertTo-SecureString -String $pwd -AsPlainText -Force) -EnableRoomMailboxAccount $true
Set-Mailbox -Identity $newRoom -MailTip “This room is equipped to support Teams Meetings”
Set-CalendarProcessing -Identity $newRoom -AutomateProcessing AutoAccept -AddOrganizerToSubject $false -RemovePrivateProperty $false -DeleteComments $false -DeleteSubject $false -AddAdditionalResponse $true -AdditionalResponse “Your meeting is now scheduled and if it was enabled as a Teams Meeting will provide a seamless click-to-join experience from the conference room.”
//Wait 30 seconds and run the Set-MsolUser cmdlet to disable password expiration and set the UsageLocation :
Set-MsolUser -UserPrincipalName $newRoom -PasswordNeverExpires $true -UsageLocation $location
Set-MsolUserLicense -UserPrincipalName $newRoom -AddLicenses $license