You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何配置Windows Defender防火墙规则及应用控制,使Microsoft Teams在Windows 10受限环境下正常运行?

Let's break this down into two clear parts: getting Teams working with Windows Defender's restricted app allowlist, and setting up the firewall rules to keep it running smoothly.

一、 Fixing Windows Defender App Control for Restricted App Mode

Your current rules aren't taking effect because Teams relies on more than just Teams.exe and Update.exe to operate, and relative paths can cause resolution issues. Here's the step-by-step fix:

  1. Use Environment Variables or Full Paths
    Ditch the relative path AppData\Local\Microsoft\Teams\current\Teams.exe—instead use the flexible environment variable %LOCALAPPDATA%\Microsoft\Teams\current\Teams.exe or the full expanded path like C:\Users\<YourUsername>\AppData\Local\Microsoft\Teams\current\Teams.exe. This ensures the system always finds the correct executable.

  2. Add All Required Teams Processes to the Allow List
    Teams needs these additional executables to function properly:

    • %LOCALAPPDATA%\Microsoft\Teams\current\Electron.exe (Electron framework host for core app functionality)
    • %LOCALAPPDATA%\Microsoft\Teams\current\resources\app.asar.unpacked\modules\desktop-native\TeamsHost.exe (Handles calls, screen sharing, and native integrations)
    • %LOCALAPPDATA%\Microsoft\Teams\Update.exe (Critical for auto-updates and background maintenance)
  3. Use Publisher Rules for Auto-Update Compatibility
    Teams updates frequently, which can change the current folder to a version-specific directory—breaking path-based rules. Publisher rules (based on digital signatures) are far more reliable:

    • Run gpedit.msc to open the Local Group Policy Editor
    • Navigate to Computer Configuration > Windows Settings > Security Settings > Application Control Policies > AppLocker > Executable Rules
    • Right-click "Executable Rules" > "Create New Rule"
    • Skip the welcome screen, select "Allow", and choose "All Users" (or specific user groups)
    • Select "Publisher" as the rule condition, click "Browse" and select Teams.exe from its install path
    • Set the publisher to Microsoft Corporation, product name to Microsoft Teams, and check "Use wildcard" for the version field to cover all future updates
    • Repeat this for Update.exe—any signed Teams executable will now be allowed, even after updates.
  4. Enable the Application Identity Service
    AppLocker depends on this service to enforce rules:

    • Press Win + R, type services.msc, and hit Enter
    • Locate "Application Identity", set its startup type to "Automatic", then start the service. Restart your PC if changes don't take effect immediately.
二、 Configuring Windows Defender Firewall Rules for Teams

Teams needs both inbound and outbound firewall access to handle messages, calls, updates, and screen sharing. Here's how to set it up:

  1. Open Advanced Firewall Settings
    Search for "Windows Defender Firewall" in the Start menu, then click "Advanced settings" on the left sidebar.

  2. Create Outbound Rules (For Internet Access)
    Outbound rules let Teams connect to Microsoft's servers:

    • Right-click "Outbound Rules" > "New Rule"
    • Select "Program" > Next
    • Click "Browse" and select %LOCALAPPDATA%\Microsoft\Teams\current\Teams.exe > Next
    • Choose "Allow the connection" > Next
    • Check all network types (Domain, Private, Public) unless you have specific security restrictions > Next
    • Name the rule "Allow Microsoft Teams Outbound" > Finish
    • Repeat this process for Update.exe, Electron.exe, and TeamsHost.exe to cover all background processes.
  3. Create Inbound Rules (For Calls & Screen Sharing)
    Inbound rules let other users connect to your Teams sessions:

    • Right-click "Inbound Rules" > "New Rule"
    • Select "Program" > Next
    • Browse to Teams.exe > Next
    • Choose "Allow the connection" > Next
    • Select the relevant network types > Next
    • Name the rule "Allow Microsoft Teams Inbound" > Finish
    • As an alternative, you can use the basic firewall interface: Go to "Allow an app or feature through Windows Defender Firewall", click "Change settings", find "Microsoft Teams" (or add it manually if missing), and check the boxes for the networks you use.
  4. Optional: Port-Based Rules (Granular Control)
    If you need fine-grained port access, Teams uses these primary ports:

    • UDP 3478-3481 (STUN for call connectivity)
    • TCP 443 (HTTPS for messages and updates)
    • UDP 50000-50019 (Media streaming for calls/sharing)
      Create port-based rules for these if program-based rules aren't sufficient for your environment.

内容的提问来源于stack exchange,提问作者Dummy

火山引擎 最新活动