A glowing cybersecurity network diagram connects user workstations and server racks behind multiple firewalls.
Keep Windows Firewall on, even behind a perimeter firewall. Consider a file server: employees need to reach its shares, but they probably don’t need to reach its Remote Desktop sign-in screen. If a workstation and the server communicate directly on the same network segment, neither connection passes through the internet-facing firewall. A rule on the server can allow file sharing from employee networks while reserving Remote Desktop for administrators. That distinction matters most when a workstation inside the perimeter is no longer trustworthy.

The harder question is how to restore that protection on a server that has run without it for years. Writing for Petri, administrator Alexandru Cazan describes a familiar predicament: an application once failed, someone disabled the firewall, and the workaround outlived the explanation. His proposal is to observe real traffic before enforcing new restrictions. It’s a migration procedure, not a change introduced by a Windows update. Microsoft’s underlying firewall guidance covers Windows Server 2016, 2019, 2022 and 2025, as well as Windows 10 and 11. The rollout below focuses on domain-managed servers.

A glowing cybersecurity network diagram connects user workstations and server racks behind multiple firewalls. 1. Find out which policy the server is actually using​

Start with one representative server, an elevated PowerShell session and a way to reach its console if remote management stops working. Record the starting configuration and identify who controls it. If a domain Group Policy Object (GPO) determines firewall settings, plan the pilot and its rollback there. A local change that looks right in a PowerShell window is not necessarily the policy Windows will enforce. Microsoft calls the combined policy in force on the machine the ActiveStore.

Code:
Get-NetConnectionProfile |
    Select-Object InterfaceAlias, NetworkCategory

Get-NetFirewallProfile -PolicyStore ActiveStore |
    Select-Object Name, Enabled, DefaultInboundAction, LogAllowed, LogBlocked, LogFileName

Get-Service -Name MpsSvc

Get-NetFirewallRule -PolicyStore ActiveStore -Enabled True -Direction Inbound -Action Block |
    Select-Object DisplayName, Profile

The first two queries answer different questions. The first tells you how Windows classifies each network connection; the second shows the settings for each firewall profile. Domain membership alone does not establish that the Domain profile is active on a particular interface: Windows must detect the domain network. If the interface is using Public, changing Domain settings won’t test what you think it will. Investigate the discrepancy rather than weakening the Public profile to make the test pass.

Keep the list of explicit inbound blocks. A profile’s default action governs traffic that doesn’t match a rule; it does not cancel those blocks. Microsoft also documents that an explicit block wins against a conflicting allow. That explains a seemingly contradictory result: a newly enabled firewall can interrupt an application even when the profile says its default inbound action is Allow. Adding another allow rule won’t resolve that conflict.

2. Observe a disabled profile without weakening a protected one​

If the firewall is already enabled and blocking unsolicited inbound traffic, leave that protection in place. Enable logging and investigate particular failures. Cazan’s temporary default-Allow approach is for a different starting point: a disabled firewall profile on a server whose dependencies are poorly understood. Set an end date for that observation period. On a locally managed pilot where Domain is the intended profile, the following enables the profile and records both permitted connections and dropped packets. It does not change the Private or Public profile.

Code:
$pilot = @{
    Profile             = 'Domain'
    Enabled             = 'True'
    DefaultInboundAction = 'Allow'
    LogAllowed          = 'True'
    LogBlocked          = 'True'
    LogMaxSizeKilobytes = 32767
}
Set-NetFirewallProfile @pilot

For a centrally managed pilot, configure the equivalent settings in the scoped GPO. In Group Policy, the firewall console is under Computer Configuration → Policies → Windows Settings → Security Settings → Windows Firewall with Advanced Security. Open the firewall properties, select the intended profile and customize its logging. After policy applies, check ActiveStore again. Make a known inbound connection and confirm that a corresponding record appears before leaving the server to collect a week’s worth of nothing.

Retention deserves attention from day one. The default file is %windir%\System32\LogFiles\Firewall\pfirewall.log. Microsoft documents a default size limit of 4,096 KB, recommends at least 20,480 KB and permits up to 32,767 KB. Its logging guide says older entries are deleted as space is needed; don’t base collection on the assumption that a usable pfirewall.log.old will be waiting. Collect or forward records before they disappear. Separate filenames for Domain, Private and Public also make it easier to tell which profile produced the evidence. If no entries appear, check the configured path, whether the folder exists and whether MpsSvc can write there.

3. Turn connection records into a dependency list​

Cazan suggests observing at least one business week, preferably including month-end. Use the workload calendar rather than treating seven days as a pass mark. Ask the application owner when accounting runs its export, when backups use the server, and which reports don’t run daily. If a job falls outside the window, arrange a test or record it as an unverified dependency. A busy week of ordinary file access tells you little about a monthly process that never started.

For the firewall text log, read its #Fields: header rather than assuming a fixed column order. Select records with action ALLOW and path RECEIVE, group them by protocol and destination port, and retain the distinct source addresses in each group. Use the destination port because the question is which service the client reached on this server. Keep the original records, too: if a scheduled job fails later, its timestamp can be more useful than a count of several thousand successful connections.

If a port number doesn’t identify the application, Windows Filtering Platform auditing can help. Security event 5156 describes a permitted connection. Microsoft’s event documentation identifies an application path, process ID, direction, addresses and ports. Check direction before attributing an inbound dependency to a program. Successful connection auditing can generate very high event volumes, so use it for a bounded investigation and restore the previous audit setting afterward. Record that setting first; don’t turn off auditing another team already relies on.

The result should be a short set of questions for the service owner, not an automatically generated allowlist. For example, SMB on TCP 445 from client networks might be the file server doing its job. Remote Desktop on TCP 3389 from those same networks raises a different question: should anyone there administer it? WinRM on TCP 5985 from a designated management server may be legitimate without justifying access from every domain workstation. The ports are examples. The useful inventory records the service, which sources need it and why.

4. Write rules for the server role, not just the port​

Start with Windows’ built-in rules for the role and inspect their profiles and address scopes. The File and Printer Sharing group is a useful place to look on a file server, not a reason to enable every rule in the group on every host. For a custom exception, specify the approved sources. This example permits inbound TCP traffic to the usual RDP port on the Domain profile. Replace the illustrative subnet with the one from which your administrators actually connect.

Code:
$rdpRule = @{
    DisplayName   = 'RDP TCP from administration subnet'
    Direction     = 'Inbound'
    Profile       = 'Domain'
    Protocol      = 'TCP'
    LocalPort     = 3389
    RemoteAddress = '10.10.50.0/24'
    Action        = 'Allow'
}
New-NetFirewallRule @rdpRule

There’s an important catch: adding this rule does not revoke access granted by an existing rule that permits RDP from everywhere. Nor will it exclude other sources while the profile’s default inbound action remains Allow. Inspect overlapping permissions before enforcement. Then test from both sides of the intended boundary: an authorized management machine should connect, and an ordinary workstation outside that scope should not. Testing only from the administrator’s desk verifies access, not the restriction.

Handle Remote Procedure Call (RPC) separately. A domain controller’s log can show connections to high-numbered ports in the 49152–65535 range. Opening that entire range because several numbers appeared in a log grants more than the observation justifies. Microsoft documents a two-rule design: one permits approved clients to reach the RPC Endpoint Mapper on TCP 135; the other permits the subsequent connection to a dynamically assigned RPC port for the intended service. Use the endpoint-mapper and dynamic-RPC rule options, limit the remote sources and test the actual operation. Reaching port 135 alone verifies only the first half of the exchange.

5. Enforce default block and prove the workload still works​

Put the reviewed rules in a role-specific GPO and apply it to the pilot before expanding its scope. Check whether central policy permits local firewall rules to merge: an exception created by an installer or an administrator on a test machine might not take effect under the production policy. Confirm the effective rules on the pilot itself. For a locally controlled Domain profile, the enforcement command is Set-NetFirewallProfile -Profile Domain -DefaultInboundAction Block. In a GPO-managed deployment, change the corresponding setting in the governing policy instead.

Run one real transaction per dependency. Open a share from an authorized client, establish a new management connection from the admin network, and have the application owner exercise the workflow that justified each unusual exception. Include a negative test for management access. Keep dropped-packet logging enabled and review it daily during the first week. Match a failed job’s time, source and destination to a DROP record before changing a rule. A drop with no corresponding business need may mean the policy is doing exactly what it should.

For a pilot migrated from disabled through default Allow, a time-limited rollback can restore the previous observation setting without stopping either filtering or logging: Set-NetFirewallProfile -Profile Domain -DefaultInboundAction Allow. Use the policy source that controls the setting, and remember that explicit blocks remain. If a specific rule caused the outage, correct that rule; changing the default won’t fix it. Expand to other servers of the same role only after verifying both the permitted workloads and the access you meant to deny.

When a vendor requires the firewall off​

An appliance-like Windows server with a documented vendor support requirement is a narrow exception. Confirm the requirement applies to the installed version. If it does, isolate the host in a dedicated network segment, filter traffic entering that segment and record the reason, owner and review date. The placement matters: a filtering device between segments can protect the path that crosses it, but it still won’t control direct communication between neighbors inside the exception segment.

Disable only the necessary firewall profile; leave the Windows Defender Firewall service (MpsSvc) running. Microsoft does not support stopping the service to turn off the firewall. Its guidance also identifies Windows Service Hardening, IPsec connection security rules and boot-time filtering among the reasons not to disable Windows Firewall casually. For an ordinary domain server, the more useful outcome is a policy the next administrator can explain: employees can reach the share, administrators can manage the host, and neither group gets the other’s network access by accident.

 

References

  1. Windows Firewall Behind a Perimeter Firewall: Turn It Off or Not? Petri IT Knowledgebase 2026-11-30T14:24:02+00:00
  2. Windows Firewall | Microsoft Learn learn.microsoft.com
  3. Windows Firewall | Microsoft Learn learn.microsoft.com