Download and install the Microsoft Teams app using Intune

I was looking for an ‘easy’ way to push the Microsoft Teams app to devices using Intune.

Since the ‘Windows S’ Teams app is no longer available, the options were to either create a ‘Line of Business’ app in Intune or use Graph API. Both valid options, but – why?

Looking at the documentation to install Microsoft Teams using MSI, you can use System Center Configuration Manager, Group Policy or any third-party distribution mechanisms for broad deployment. As Intune falls into the latter, if you’re on a modern-managed environment – I prepared a script for that purpose.

The script will do the following:

  • Download the x64 MSI installer directly from Microsoft. (You can use the x86 MSI as well if you need)
  • Extract the installer to a folder on the client machine and run the installation quietly with the least possible privileges .

New-Item -ItemType Directory -Force -Path  C:\TeamsAutomation
Set-Location C:\TeamsAutomation
Invoke-WebRequest -Uri "https://aka.ms/teams64bitmsi" -OutFile "Teams_windows_x64.msi"
msiexec /i Teams_windows_x64.msi

Based on the default behavior of the installer, whenever a user signs into a new Windows User Profile, the installer will be launched and a copy of the Teams application will be installed in that user’s appdata folder. If a user already has the Teams app installed in the appdata folder, the MSI installer will skip the process for that user. So you can rest assure that the client doesn’t reinstall itself every time a user signs in.

Save the above script as a .ps1 file and upload in to Intune PowerShell:

In the Intune Devices Management Portal (https://aka.ms/apmgmt), go to Device configuration – PowerShell scripts and click to Add a new PowerShell script.

Provide a name and the location of the .ps1 file you created:

Upload Script

 

Click to configure settings, and make sure that both ‘Run this script using the logged on credentials’ and ‘Enforce script signature check’ are set to ‘No’:

Script Settings

Click ‘OK’ and ‘Create’ and assign the scripts to the device groups you desire.

Right after syncing, you’ll see the following events on your machine:

1040(1)

11707(2)

1033)3)

These will confirm that the installation was successful and users will be signed in to Teams automatically on the next log on.

 

 

 

 

 

 

Advertisements