How to install the Teams Module on a SfB FE Server.

Hi folks, here is my good weed for the day. We have had a bit of sun which meant I have been devoting more time to the family allotment. I told myself this year I was going to get a handle on the weeds, so far weeds 1 – Tayo 0. The slugs are also out in force, and I have been taking suggestions on how to best tackle the slimy invaders in a humane way. Slugs 1 – Tayo 0.

Today however, I want to talk about installing the Microsoft Teams PowerShell Module on a Skype for Business Front End Server.

With the Skype for Business Online Connector connections being rejected starting May 17, 2021, you should consider migrating from Skype for Business Online Connector to the Teams PowerShell module. Steps to do this can be found here .

However, it is not that straight forward – install the latest Teams PowerShell Module the step states – and helpfully supplies a link . This same link has all the necessary prerequisites, and you do need to pay attention to those.

Here is what I found.

I started with the popular Get-Module -ListAvailable to see if perchance someone has installed the MicrosoftTeams module on the server and saving me the need to continue with this article.

There were no surprises.

Using the Get-InstalledModule cmdlet which retrieves PowerShell modules that are installed on a computer using PowerShellGet.

Okay, possibly the PowerShellGet module is missing, so let us remedy that by installing it using:

Install-Module -Name PowerShellGet -Force -AllowClobber

Wait, the error message refers me to check my Internet Connection and being unable to find a “match for the specified search criteria and provider name ‘Nuget’”.

Well, I know this server has got internet access because it is used for Move-CsUser operations to Skype for Business Online, and internet access is one of the prerequisites for Hybrid Modern Authentication for Skype for Business.

PowerShell Gallery has deprecated Transport Layer Security (TLS) versions 1.0 and 1.1 and TLS 1.2 is now the default encryption used for all client-server connections to the PowerShell Gallery. So let us change our PowerShell connection to comply.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

InstallModule PowerShellGet RequiredVersion 2.2.4 SkipPublisherCheck

Now we can connect to the PowerShell Gallery and install PowerShellGet.

Now to attempt to install the MicrosoftTeams module.

What is with the 60427965.00MB? I hope it is not true as I do not have that much storage on this server.

All going swimmingly. Now to import the module.

Import-Module MicrosoftTeams

That was quick.

Cannot verify the Microsoft .NET Framework Version 4.7.2 because it is not included in the list of permitted versions.

Import-Module : Could not load file or assembly ‘file:///C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\2.3.1\net472\Microsoft.TeamsCmdlets.PowerShell.Connect.dll’ or one of its dependencies. Operation is not
supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ Import-Module MicrosoftTeams
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], FileLoadException
+ FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand

Ah yes, .NET Framework Version 4.7.2 was listed in the list of requirements for installing the Microsoft Teams PowerShell module.

So, do we have .NET 4.7.2 installed on this box?

(Get-ItemProperty “HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full”).Release -ge 461808 .

(461808 is the release number for .NET Framework Version 4.7.2).

If you run a Get-Command “*Teams*”, it shows the list of available cmdlets with Teams, and conspicuously missing are the Cs* cmdlets.

We installed the .NET Framework 4.7.2 as per the requirements.

And we have our Cs* cmdlets from Get-Command “*Teams*”.

Finally try connecting to MicrosoftTeams with the difficult to remember cmdlet:

Connect-MicrosoftTeams .

We know this worked because of the output.

I am now able to perform my user migrations to Microsoft Teams.

Disconnect from Microsoft Teams using the cmdlet below (not Remove-PSSession)

I believe the above steps are also valid for other applicable server roles that does not have the prerequisites installed. In my example, I needed it on the Skype for Business FE (which could easily have been any other management server that had the Skype for Business Online Connector installed).

Having done my good seed for the day, I will go eat, drink and be rosemary. Peas.

Tags: