-
Notifications
You must be signed in to change notification settings - Fork 4
/
install-new-teams-v2.ps1
146 lines (108 loc) · 6 KB
/
install-new-teams-v2.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<#
.SYNOPSIS
Installs the new Microsoft Teams x64 on Windows Server 2022, Windows 10 and Windows 11 multiuser,
including the Outlook Add-in and sets required registry keys for Citrix VDA as well.
The new Teams is based on EdgeWebView Runtime and willbe installed as well.
You must set per User registry keys to load the Outlook Add-in via GPO, WEM etc. For GPO
find the xml file at https://www.koetzingit.de with the article to this script.
.Author
Thomas@koetzingit.de
https://www.koetzingit.de
.LINKS
https://learn.microsoft.com/en-us/microsoftteams/new-teams-vdi-requirements-deploy
https://learn.microsoft.com/en-us/microsoftteams/troubleshoot/meetings/resolve-teams-meeting-add-in-issues
https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/multimedia/opt-ms-teams.html
.NOTES
- You must run the script as administrator but will be chechked by the script.
- You need free internet access to download the resources
.Version
- 1.0 creation 03/30/24
- 2.0 Download source media
- 2.1 Temas register timeout
#>
#
# Set install path with containing MSTeams-x64.msix,teamsbootstrapper.exe and MicrosoftEdgeWebView2RuntimeInstallerX64.exe
#
$InstallPath = (Get-Location).Path
#
# Check Admin function
#
Function Check-RunAsAdministrator()
{
#Get current user context
$CurrentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
#Check user is running the script is member of Administrator Group
if($CurrentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator))
{
Write-host "Script is running with Administrator privileges!"
}
else
{
#Create a new Elevated process to Start PowerShell
$ElevatedProcess = New-Object System.Diagnostics.ProcessStartInfo "PowerShell";
# Specify the current script path and name as a parameter
$ElevatedProcess.Arguments = "& '" + $script:MyInvocation.MyCommand.Path + "'"
#Set the Process to elevated
$ElevatedProcess.Verb = "runas"
#Start the new elevated process
[System.Diagnostics.Process]::Start($ElevatedProcess)
#Exit from the current, unelevated, process
Exit
}
}
#
#Check Script is running with Elevated Privileges
#
Check-RunAsAdministrator | Out-Null
#
# Add .NET 3.x Feature as required for the Outlook Add-in
#
Write-Host "`nEnable .NET 3.x Feature`n"
Start-Process -wait -NoNewWindow -FilePath DISM.exe -Args "/Online /Enable-Feature /FeatureName:NetFx3 /All"
#
# Download and Install EdgeWebView Runtime
#
Start-BitsTransfer -Source 'https://go.microsoft.com/fwlink/?linkid=2124701' -Destination "$InstallPath\MicrosoftEdgeWebView2RuntimeInstallerX64.exe" -Description "Download latest EdgeWebView Runtime"
Write-Host "`nInstall EdgeWebView Runtime. Please wait.`n"
Start-Process -wait -FilePath "$InstallPath\MicrosoftEdgeWebView2RuntimeInstallerX64.exe" -Args "/silent /install" | Out-Null
#
# Install New MS Teams MSIX
#
Write-Host "`nDownload and Install New Microsoft Teams. Please wait.`n"
Start-BitsTransfer -Source "https://go.microsoft.com/fwlink/?linkid=2196106" -Destination "$InstallPath\MSTeams-x64.msix" -Description "Download latest Microsoft teams version" | Out-Null
Start-BitsTransfer -Source "https://go.microsoft.com/fwlink/?linkid=2243204" -Destination "$InstallPath\teamsbootstrapper.exe" -Description "Download teams bootstrapper" | Out-Null
Start-Process -wait -FilePath "$InstallPath\teamsbootstrapper.exe" -Args "-p -o ""$InstallPath\MSTeams-x64.msix""" -NoNewWindow| Out-Null
#
# Time to fully register MSIX package
#
Write-Host "30 seconds Timout for the MSIX package to fully register."
Start-Sleep -Seconds 30
#
# Set Registry values for VDI and Citrix
#
Write-Host "`nSet registry keys for VDI and Citrix.`n"
New-Item -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Teams" -Force | Out-Null
New-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Teams" -Name "disableAutoUpdate" -Type dword -Value 1 -force | Out-Null
New-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Teams" -Name "IsWVDEnvironment" -Type dword -Value 1 -force | Out-Null
New-Item -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\WebSocketService" -Force | Out-Null
New-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\WebSocketService" -Name "ProcessWhitelist" -Type MultiString -Value "msedgewebview2.exe" -force | Out-Null
#
# Install and register MS Teams Outlook Add-In
#
Write-Host "`nInstall Microsoft Teams Add-in for Outlook.`n"
$MSTappx = (Get-AppxPackage | Where-Object -Property Name -EQ -Value MSTeams)
$MSTappVer = $MSTappx.Version
$MSTappxPath = $MSTappx.InstallLocation
$MSIname = "MicrosoftTeamsMeetingAddinInstaller.msi"
$MSTAddinMSI = "$MSTappxPath\$MSIName"
$applockerinfo = (Get-AppLockerFileInformation -Path $MSTAddinMSI | Select -ExpandProperty Publisher)
$MSTbinVer = $applockerinfo.BinaryVersion
$targetDir = "C:\Program Files (x86)\Microsoft\TeamsMeetingAddin\$MSTbinVer"
#
# Pre-creation of the log file and folder.
#
New-Item -ItemType Directory -Path "C:\Program Files (x86)\Microsoft\TeamsMeetingAddin" -Force | Out-Null
New-Item -ItemType File "C:\Program Files (x86)\Microsoft\TeamsMeetingAddin\MSTMeetingAddin.log" -Force | Out-Null
Start-Process "msiexec" -ArgumentList @("/i ""$MSTAddinMSI""","/qn","/norestart ALLUSERS=1 TARGETDIR=""$targetDir"" /L*V ""C:\Program Files (x86)\Microsoft\TeamsMeetingAddin\MSTMeetingAddin.log""") -Wait
Start-Process "c:\windows\System32\regsvr32.exe" -ArgumentList @("/s","/n","/i:user ""$targetDir\x64\Microsoft.Teams.AddinLoader.dll""") -wait
Write-Host "`n Finished!`n"