SMB: File and printer sharing ports should be open

Applies To: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2

When a Best Practices Analyzer scan for Server Message Block (SMB)-based network services identifies that firewall ports for file and printer sharing aren't open, follow the steps in this article to resolve the issue.

Operating system Product/Feature Severity Category
Windows Server File Services Error Configuration

Note

This article addresses a specific issue identified by a Best Practices Analyzer scan. Apply the information in this article only to computers that have a File Services Best Practices Analyzer scan that reports the specific port issue. For more information about best practices and scans, see Best Practices Analyzer.

Identify the issue

A File Services Best Practices Analyzer scan reports that firewall ports necessary for file and printer sharing aren't open (ports 445 and 139).

The issue prevents computer access to shared folders and other SMB-based network services on the server.

Resolve the issue

To resolve the issue, enable file and printer sharing to communicate through the computer's firewall. To complete the procedure, you must be a member of the Administrators group (or equivalent), at a minimum.

To open the firewall ports and enable file and printer sharing, complete the following steps:

  1. Open Control Panel, select System and Security, and then select Windows Defender Firewall.

  2. On the left, select Advanced settings. The Windows Defender Firewall console opens and shows the advanced settings.

  3. In the Windows Defender Firewall console on the left, select Inbound Rules.

  4. Under Inbound Rules, locate the following two rules:

    • File and Printer Sharing (NB-Session-In)

    • File and Printer Sharing (SMB-In)

  5. For each rule, select and hold (or right-click) the rule, and then select Enable Rule.