<#
.SYNOPSIS
This is for the Windows 11 build devices which gets the consumer version and work version of teams installed.
.DESCRIPTION
Disablewindows11teamsconsumer
.PARAMETER
Default Parametername
.EXAMPLE
powershell -executionpolicy bypass -file DisableTeamsforWindows11.ps1
.NOTES
NAME: <SystemTagging>
AUTHOR: Engineering
KEYWORDS: Keyword1
.CHANGE
Author : Kamal 14/09/2022
Version 1.0
#>
Function main {
## Allows the use of -WhatIf
[CmdletBinding(SupportsShouldProcess=$True)]
param(
## LogFile path for the transcript to be written to
[Parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true,Position=0)]
$LogFile = ("C:\xyz\LOGS\"+"DisableTeamsconsumerInstallwforwindows11"+'.log'),
## All verbose outputs will get logged in the transcript($logFile)
[Parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true,Position=2)]
$VerbosePreference = "Continue",
## All errors should be withheld from the console
[Parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true,Position=3)]
$ErrorActionPreference = "SilentlyContinue"
)
## Begin the timer
$Starters = (Get-Date)
## Check $VerbosePreference variable, and turns -Verbose on
Function global:Write-Verbose ( [string]$Message ) {
if ( $VerbosePreference -ne 'SilentlyContinue' ) {
Write-Host "$Message" -ForegroundColor 'Green'
}
}
Start-Transcript -Path $LogFile
Write-Verbose "Start time: $starters"
## Check $VerbosePreference variable, and turns -Verbose on
Function global:Write-Verbose ( [string]$Message ) {
if ( $VerbosePreference -ne 'SilentlyContinue' ) {
Write-Host "$Message" -ForegroundColor 'Green'
}
}
Function WriteToTeams {
$regRoot = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Communications"
$installDate = (Get-Date -Format "yyyy-MM-dd HH:mm:ss")
$objScriptTime = New-Object -ComObject WbemScripting.SWbemDateTime
$objScriptTime.SetVarDate($installDate)
$installDateDMTF = $objScriptTime.Value
md $regRoot -force
New-ItemProperty $regRoot -Name "ConfigureChatAutoInstall" -Value "0" -PropertyType "String" -Force
}
WriteToTeams
## Completed Successfully!
Write-Host (Stop-Transcript) -ForegroundColor Green
}
main
Setting | Value |
---|---|
Name | Remove Chat |
Description | Removes Windows 11 Teams Chat |
OMA-URI | ./Device/Vendor/MSFT/Policy/Config/Experience/ConfigureChatIcon |
Data type | Integer |
Value | 3 |
Managing the Teams Chat icon on Windows 11 – Windows Client | Microsoft Docs – refer this link for the settings.
Getting rid of Teams (consumer), revisited – Out of Office Hours (oofhours.com) – we did this work based on the Mike blog.
Leave a comment