Skip to content

Instantly share code, notes, and snippets.

@billdeitrick
Last active October 18, 2019 03:22
Show Gist options
  • Save billdeitrick/93647629becdb4372f4de389b1a8fd6c to your computer and use it in GitHub Desktop.
Save billdeitrick/93647629becdb4372f4de389b1a8fd6c to your computer and use it in GitHub Desktop.
This script deploys Microsoft Teams with "autoStart" set to false. This means that Teams won't start large and in charge automatically when the user logs in, until they've run the app for the first time. Works great pushed from Intune.
if ((Test-Path -Path "C:\Program Files (x86)\Teams Installer\setup.json") -eq $false) {
if ((Test-Path -Path "C:\IntunePSTeamsInstall") -eq $true) {
Remove-Item -Path "C:\IntunePSTeamsInstall" -Recurse -Force
}
New-Item -Path "C:\IntunePSTeamsInstall" -ItemType Directory -Force > $null
Set-Location -Path "C:\IntunePSTeamsInstall"
Add-Content "install.log" -Value (((Get-Date).DateTime.toString()) + " Downloading installer file.")
Invoke-WebRequest -Uri "https://aka.ms/teams64bitmsi" -OutFile "Teams_windows_x64.msi" -UseBasicParsing
$found_file = Test-Path -Path "Teams_windows_x64.msi"
Add-Content "install.log" -Value (((Get-Date).DateTime.toString()) + " Done downloading installer file. Files is present: $found_file")
Add-Content "install.log" -Value (((Get-Date).DateTime.toString()) + " Executing installer.")
msiexec /i Teams_windows_x64.msi OPTIONS="noAutoStart=true" /qn
Add-Content "install.log" -Value (((Get-Date).DateTime.toString()) + " Handed off to msiexec.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment