This PowerShell script downloads and installs the Microsoft Teams MSI installer based on the architecture of the computer (32-bit or 64-bit). If everything goes smoothly, the script will return an “Installed” message, letting you know that you’re ready to rock and roll.
The Script:
Atera does not guarantee the integrity, availability, security, virus-free, safety, lawfulness, non-infringement, rights’ status, or functionality of the scripts. The use of the shared scripts is at your own risk. Scripts are provided “AS IS”. *
Param( $url, $TeamsPath = "c:\temp\teams.msi" )
$url32 = 'https://aka.ms/teams32bitmsi'
$url64 = 'https://aka.ms/teams64bitmsi'
if(!$url){
if([Environment]::Is64BitOperatingSystem){
$url = $url64
}
else{
$url = $url32
}
}
$client = new-object System.Net.WebClient
$client.DownloadFile($url,$TeamsPath)
$return = Start-Process msiexec.exe -Wait -ArgumentList "/I $TeamsPath /qn /norestart" -PassThru
if(@(0,3010) -contains $return.ExitCode){
return 'Installed'
}
else{
return 'Error Installing'
}
Technical Notes:
- This script will run on Windows 10 and 11.
- Admin permissions needed to run this script.
- An internet connection is required to download the Microsoft Teams MSI package.
- Based on the computer’s architecture, it will set the download url as https://aka.ms/teams32bitmsi for 32-bit or https://aka.ms/teams64bitmsi for 64-bit.
- The downloaded file is saved to the C:\temp directory with the filename “teams.msi”.
- The MSI installer is executed using the msiexec.exe command with specified arguments to perform a silent installation. This means there is no user interface or prompts, and no surprise device restarts.