当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法

作者:精品下载站 日期:2024-12-14 10:04:32 浏览:13 分类:玩电脑

在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法


在这篇文章中,我将向您展示禁用 Microsoft Teams 自动启动的多种方法。用户经常询问如何防止 Microsoft Teams 在 Windows 启动时打开,有一些简单的方法可以做到这一点。

安装 Office 2021 或 Microsoft 365 时,默认情况下会安装包括 Microsoft Teams 在内的所有 Office 应用。尽管使用 Configuration Manager,您可以自定义 Office 365 部署并排除 Teams 安装。

MS Teams 设置为在用户登录计算机时自动启动。如果您不使用 Microsoft Teams 或者不希望它消耗您的主机资源,您可以禁用 Microsoft Teams 自动启动。

下面的屏幕截图显示了 Teams 启动启动的图示。尽管可以关闭该应用程序,但每次登录 Windows 时都必须这样做。我们将讨论一些永久消除启动时启动的 Teams 的方法。

[玩转系统] 在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法

方法 1:手动禁止 Teams 在启动时打开

您可以在其设置中手动禁用 Microsoft Teams 自动启动。打开 Teams 应用,然后转到设置 > 常规 > 应用程序。取消选中自动启动应用程序选项。重新启动 Microsoft 团队应用程序。

[玩转系统] 在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法

方法 2:从任务管理器禁用 Microsoft Teams 自动启动

Windows 上的任务管理器允许您监视正在运行的进程、测量系统性能并列出用户、详细信息和服务。任务管理器的启动选项卡显示设置为每次启动时自动启动的应用程序列表。

用户可以选择从任务管理器禁用 Microsoft Teams 自动启动,这样它就不会自动启动。为此,他们需要执行以下步骤:

要打开任务管理器,请按 Ctrl + Shift + Esc 键或右键单击任务栏并选择任务管理器 。在“任务管理器”窗口中,切换到启动选项卡。右键单击 Microsoft Teams,然后选择禁用

[玩转系统] 在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法

现在我们看到 Microsoft Teams 应用程序的状态为已禁用。这可确保 Teams 应用程序不会在启动过程中自动启动。

[玩转系统] 在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法

方法 3:使用注册表阻止 Microsoft Teams 自动启动

注册表是可用于确保 Microsoft Teams 在启动过程中不会自动启动的方法之一。在对 Windows 注册表进行任何更改之前,请确保对其进行完整备份。

在 Windows PC 上,右键单击“开始”并选择运行。输入命令regedit并单击回车键启动注册表编辑器。在注册表编辑器中,导航到以下路径:

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

从上面的注册表路径中,删除 com.squirrel.Teams.Teams 注册表参数。更改注册表后必须重新启动计算机。下次登录时,您会发现 Microsoft Teams 不会自动启动。

[玩转系统] 在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法

方法 4:使用 PowerShell 脚本禁用 Teams 自动启动

默认情况下,Microsoft Teams 在安装后当用户登录其计算机时会自动启动。 Microsoft 提供了一个 PowerShell 脚本来根据每个用户重置 Teams 自动启动设置。

如果您已经在组织中部署了 Teams,并且想要设置“防止 Microsoft Teams 在安装后自动启动”组策略设置来禁用 Teams 自动启动,则需要首先设置组策略设置为您想要的值,然后运行此脚本。为用户启动 Teams 后,无法使用组策略禁用自动启动设置。

以下 PowerShell 脚本由 Microsoft 提供。

<#
.SYNOPSIS
This script allows you to reset all autostart settings to the default settings for Teams.
.DESCRIPTION
If you want to use the "Prevent Microsoft Teams from starting automatically after installation"
Group Policy setting, make sure you first set the Group Policy setting to the value you want 
before you run this script.
#>

$ErrorActionPreference = "Stop"

$TeamsDesktopConfigJsonPath = [System.IO.Path]::Combine($env:APPDATA, 'Microsoft', 'Teams', 'desktop-config.json')

$TeamsUpdatePath = [System.IO.Path]::Combine($env:LOCALAPPDATA, 'Microsoft', 'Teams', 'Update.exe')

Function Test-RegistryValue {
    param(
        [Alias("PSPath")]
        [Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
        [String]$Path
        ,
        [Parameter(Position = 1, Mandatory = $true)]
        [String]$Name
    ) 

    process {
        if (Test-Path $Path) {
            $Key = Get-Item -LiteralPath $Path
            if ($null -ne $Key.GetValue($Name, $null)) {
                $true
            } else {
                $false
            }
        } else {
            $false
        }
    }
}

Function Test-Remove-RegistryValue {
    param (
        [Alias("PSPath")]
        [Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
        [String]$Path
        ,
        [Parameter(Position = 1, Mandatory = $true)]
        [String]$Name
    )

    process {
        if (Test-RegistryValue -Path $Path -Name $Name) {
            Write-Host "Removing registry key $Path$Name"
            Remove-ItemProperty -Path $Path -Name $Name
        }
    }
}

# when determining whether Teams should be auto-started we are checking three flags
Write-Host "Removing Auto-Start-related artifacts"

# 0. Close Teams, if running
$teamsProc = Get-Process -name Teams -ErrorAction SilentlyContinue
if ($null -ne $teamsProc) {
    Write-Host  "Stopping Microsoft Teams..."
    Stop-Process -Name Teams -Force
    # wait some time
    Start-Sleep 5
} else {
    Write-Host  "No running Teams process found"
}

# 1. Check that Teams process isn't still running
$teamsProc = Get-Process -name Teams -ErrorAction SilentlyContinue

if($null -eq $teamsProc) {
    # 2. remove HKEY_CURRENT_USER\Software\Microsoft\Office\Teams\LoggedInOnce registry key
    Test-Remove-RegistryValue -Path "HKCU:\Software\Microsoft\Office\Teams" -Name "LoggedInOnce"

    # 3. remove HKEY_CURRENT_USER\Software\Microsoft\Office\Teams\HomeUserUpn registry key
    Test-Remove-RegistryValue -Path "HKCU:\Software\Microsoft\Office\Teams" -Name "HomeUserUpn"

    # 4. remove HKEY_CURRENT_USER\Software\Microsoft\Office\Teams\DeadEnd registry key
    Test-Remove-RegistryValue -Path "HKCU:\Software\Microsoft\Office\Teams" -Name "DeadEnd"

    # 5. remove HKCU:\Software\Microsoft\Office\Outlook\Addins\TeamsAddin.FastConnect registry key
    Remove-Item -Path "HKCU:\Software\Microsoft\Office\Outlook\Addins\TeamsAddin.FastConnect" -ErrorAction SilentlyContinue

    # 6. restore HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\com.squirrel.Teams.Teams
    if (!(Test-RegistryValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "com.squirrel.Teams.Teams")) {
        Write-Host "Restoring registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Run\com.squirrel.Teams.Teams"
        Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "com.squirrel.Teams.Teams" -Value "$TeamsUpdatePath --processStart ""Teams.exe"" --process-start-args ""--system-initiated"""
    }

    # 7. We are checking whether there are entries 'isLoggedOut' and 'openAtLogin' in the desktop-config.json file
    if (Test-Path -Path $TeamsDesktopConfigJsonPath) {
        Write-Host "Changing entries 'guestTenantId', 'isLoggedOut' and 'openAtLogin' in the desktop-config.json, if exist"

        # open desktop-config.json file
        $desktopConfigFile = Get-Content -path $TeamsDesktopConfigJsonPath -Raw | ConvertFrom-Json
        $desktopConfigFile.PSObject.Properties.Remove("guestTenantId")
        $desktopConfigFile.PSObject.Properties.Remove("isLoggedOut")
        try {
            $desktopConfigFile.appPreferenceSettings.openAtLogin = $true
        } catch {
            Write-Host  "openAtLogin JSON element doesn't exist"
        }
        $desktopConfigFile | ConvertTo-Json -Compress | Set-Content -Path $TeamsDesktopConfigJsonPath -Force
    }
} else {
    Write-Host  "Teams process is still running, aborting script execution"
}

方法 5:使用组策略禁用 Teams 自动启动

在 Active Directory 环境中,您可以使用组策略阻止多台 Windows 计算机上的团队自动启动。您必须启用防止 Microsoft Teams 在安装后自动启动组策略设置。您可以在用户配置\策略\管理模板\Microsoft Teams中找到此策略设置。这是推荐的方法,因为您可以根据组织的需要关闭或打开策略设置。

部署新的组策略时,您可以在域级别或组织单位级别进行部署。我建议创建一个新的组策略对象,将其链接到具有试点计算机的测试 OU,然后将其部署到更大的计算机组。

要创建 GPO 以禁用 Microsoft Teams 自动启动,请登录到域控制器。从“开始”菜单启动服务器管理器,然后单击工具 > 组策略管理控制台。在组策略管理控制台中,展开域,右键单击组策略对象OU,然后选择新建

输入新组策略的名称。例如,您可以将 GPO 名称指定为“禁用 Microsoft Teams 自动启动”,然后点击确定。新的 GPO 已创建,并可在控制台的组策略对象列表下看到。

右键点击您刚刚创建的 GPO,然后选择编辑。在组策略管理编辑器中,导航至用户配置\策略\管理模板\Microsoft Teams。在此处查找策略设置“阻止 Microsoft Teams 在安装后自动启动”,右键单击此设置并选择编辑

[玩转系统] 在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法

此策略设置控制在安装 Teams 后用户登录设备时 Microsoft Teams 是否自动启动。如果启用此策略设置,当用户登录到设备并且用户之前未启动 Teams 时,Teams 不会自动启动。选择启用,然后单击应用确定

[玩转系统] 在 Windows 上禁用 Microsoft Teams 自动启动的 5 种方法

结论

在本文中,我介绍了多种禁用 Microsoft Teams 在启动过程中启动的方法。我希望您现在可以使用这些方法中的任何一种来摆脱 Windows PC 上的自动启动团队。

阅读下一步

  • Intune:从 Windows 11 任务栏中删除团队聊天图标
  • 如何轻松关闭 Microsoft Teams 中的动画
  • 减少 Microsoft Teams 中的背景噪音
  • 在 Microsoft Teams 中上传自定义背景
  • 轻松将 Google Analytics 与 Microsoft Teams 集成

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯