Active Directory Firewall Ports — The Complete Reference
Every port a domain, its member servers, and the enterprise stack bolted on top of it actually need — what each one carries, what breaks without it, and how to prove it is open before the change window closes.
Kerberos, LDAP, DNS, SMB and friends. Well known, easy to justify, rarely the problem.
49152-65535 on modern Windows. This is the range that gets refused, and the reason replication fails.
Most AD traffic is client-initiated, but DC-to-DC replication is initiated by both ends. Rules must be bidirectional.
The Minimum Viable AD Port Set
If you need a list to hand the network team this afternoon, this is it. These ports cover domain controller to domain controller replication and member server logon in a single-forest environment running currently supported versions of Windows Server. The sections that follow either explain one of these rows in depth or add an application on top.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 53 | TCP + UDP | Both ways | DNS | TCP is not optional. Zone transfers and large responses use it. |
| 88 | TCP + UDP | To DC | Kerberos authentication | Large tickets fall back to TCP. |
| 123 | UDP | To DC | W32Time / NTP | Kerberos fails outright once clocks drift far enough. |
| 135 | TCP | Both ways | RPC Endpoint Mapper | Only tells the caller where to go next. Useless on its own. |
| 389 | TCP + UDP | To DC | LDAP and CLDAP | UDP 389 is the DC locator ping, not a typo. |
| 445 | TCP | Both ways | SMB | SYSVOL, Group Policy, DFSR, Netlogon share. |
| 464 | TCP + UDP | To DC | Kerberos password change (kpasswd) | Missed constantly. Password changes fail, logon does not. |
| 636 | TCP | To DC | LDAP over SSL/TLS | Skip only if you are certain nothing uses LDAPS. |
| 3268 | TCP | To DC | Global Catalog LDAP | Universal group membership, cross-domain lookups. |
| 3269 | TCP | To DC | Global Catalog over SSL/TLS | Same caveat as 636. |
| 9389 | TCP | To DC | Active Directory Web Services | The entire ActiveDirectory PowerShell module rides on this. |
| 49152-65535 | TCP | Both ways | Dynamic RPC (LSA, SAM, Netlogon, DRS, DFSR) | The one that gets refused. Pinning it is covered below. |
Think of the RPC endpoint mapper on port 135 as the switchboard in an old hotel. You ring the switchboard, ask for the replication service, and the operator tells you it is on room extension 51204. If the firewall lets you reach the switchboard but not the extension, you get a perfectly successful conversation that ends in silence — which is exactly what Error 1722: The RPC server is unavailable looks like from the other side.
Domain Controller to Domain Controller
Two domain controllers replicating with each other are peers, not client and server. Either one can initiate, so the rules have to work in both directions. On top of the minimum set above, DC-to-DC traffic adds the replication engines themselves.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 135 | TCP | Both ways | RPC Endpoint Mapper | Entry point for DRS, FRS and DFSR alike. |
| 49152-65535 | TCP | Both ways | RPC for LSA, SAM and Netlogon | Carries the actual directory replication (DRSUAPI). |
| 49152-65535 | TCP | Both ways | DFSR RPC | SYSVOL replication on Server 2012 and later. |
| 5722 | TCP | Both ways | DFSR RPC (legacy) | Server 2008 and 2008 R2 only. Not used on 2012 or later. |
| 49152-65535 | TCP | Both ways | FRS RPC | Only if SYSVOL still replicates with FRS. It should not. |
| 445 | TCP | Both ways | SMB | SYSVOL content, Netlogon share, DFSR file transfer. |
| 88 | TCP + UDP | Both ways | Kerberos | DCs authenticate to each other before replicating. |
| 464 | TCP + UDP | Both ways | Kerberos password change | Includes machine account password changes. |
| 389 / 636 | TCP + UDP | Both ways | LDAP and LDAPS | Topology and configuration reads between partners. |
| 3268 / 3269 | TCP | Both ways | Global Catalog | Cross-domain and forest-wide lookups. |
| 53 | TCP + UDP | Both ways | DNS | Partners are found by GUID-based CNAME in _msdcs. |
| 123 | UDP | Both ways | W32Time | Follows the domain time hierarchy from the PDC emulator. |
| 9389 | TCP | Both ways | Active Directory Web Services | Needed for remote AD PowerShell against that DC. |
| — | ICMP | Both ways | LDAP keep-alive and redirector checks | Not a port. The Microsoft LDAP client pings a server it is waiting on. |
Two rows deserve a note. DFSR on port 5722 is version-specific: Microsoft assigned it for Windows Server 2008 and 2008 R2 domain controllers and dropped it from Server 2012 onwards, where DFSR simply uses a dynamically allocated high port like everything else. If your firewall rules still carry 5722 and your DCs are 2012 or later, the rule is dead weight — harmless, but it tells you the ruleset has not been reviewed in a decade.
ICMP is the one people delete on principle. The Microsoft LDAP client uses ICMP echo to check that a server with a pending LDAP request is still on the network, and the Windows redirector uses it when locating a server through DFS. Block it entirely and you do not lose authentication, but you inherit slow, hard-to-diagnose timeouts. Allowing ICMP to domain controller addresses specifically is the usual compromise.
Member Servers and Workstations to a DC
This is the direction most segmentation projects get wrong, because logon appears to work from a test machine long before Group Policy, password changes, or a management tool start failing. All of the following is client-initiated toward the domain controller.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 53 | TCP + UDP | Client → DC | DNS | SRV record lookup is step one of finding a DC at all. |
| 389 | UDP | Client → DC | CLDAP (DC locator ping) | How a client picks a DC in its own site. Silently critical. |
| 389 / 636 | TCP | Client → DC | LDAP / LDAPS | Directory reads by the client and by applications on it. |
| 88 | TCP + UDP | Client → DC | Kerberos | TGT and service ticket requests. |
| 464 | TCP + UDP | Client → DC | Kerberos password change | Interactive password changes and machine account rotation. |
| 445 | TCP | Client → DC | SMB | SYSVOL, so Group Policy files and login scripts. |
| 135 | TCP | Client → DC | RPC Endpoint Mapper | Netlogon secure channel, RSoP, remote policy refresh. |
| 49152-65535 | TCP | Client → DC | Dynamic RPC | Netlogon, SAM and LSA calls the endpoint mapper hands off. |
| 3268 / 3269 | TCP | Client → DC | Global Catalog | Universal group membership at logon; UPN resolution. |
| 123 | UDP | Client → DC | W32Time | Domain members sync from the domain hierarchy by default. |
| 9389 | TCP | Admin → DC | Active Directory Web Services | Only needed where admins run AD PowerShell cmdlets. |
Group Policy is worth calling out separately because it fails so distinctively. Microsoft’s requirement is that a client reach a domain controller over Kerberos, LDAP, SMB and RPC. Miss any one of those and policy does not apply or refresh — which surfaces as a policy that worked yesterday quietly going stale rather than as an error anyone reports. Remote gpupdate initiated from a management console adds RPC and WMI inbound to the target machine on 135 and the dynamic range, which is a different rule in a different direction from everything above.
For a walk through what actually happens during a logon, and why so much of it is Kerberos, the authentication and Kerberos post covers the ticket exchange these ports carry.
Trusts, Cross-Forest, and RODCs
A trust does not introduce new protocols so much as it extends the existing ones across a boundary you were probably filtering deliberately. The port set for a trust between two Windows Server 2003-or-later domains is effectively the DC-to-DC list: DNS, Kerberos, LDAP, the Global Catalog, SMB, the endpoint mapper, and the dynamic RPC range, in both directions between the domain controllers of each side.
Three specifics catch people out. W32Time over UDP 123 across an external trust is only required if you have deliberately pointed the time service at a server on the other side; it is not needed for the trust itself. UDP 138 reappears when name resolution falls back to NetBIOS, which happens with legacy or Samba-based domain controllers on the far end. And Global Catalog access matters more across a forest trust than inside a domain, because universal group enumeration for a foreign principal has to happen somewhere.
Read-only domain controllers are the interesting case for a branch or DMZ. An RODC uses the same inbound port set as a writable DC for its own clients, but its outbound relationship is one-way: it pulls from a writable partner and never pushes. That gives you a rule you can actually justify to a security team — inbound AD ports from the branch subnet to the RODC, and outbound replication from the RODC to a named set of hub DCs, with no inbound replication path from the branch into the core at all. Password changes are the exception. An RODC holds a read-only copy of the database, so a change has to be made on a writable domain controller and replicated back — which means the outbound path from the branch has to be genuinely functional rather than decorative, and an account whose password is not cached on the RODC needs to reach a writable DC to authenticate at all.
When a trust looks configured but authentication across it fails, the diagnosis is usually one of these paths rather than the trust object itself — the trust relationship failed covers that specific symptom.
Pinning the Dynamic RPC Range
Sooner or later a firewall team will refuse 49152-65535, and they are not being difficult: that is sixteen thousand ports. The supported answer is to pin Active Directory’s RPC services to specific static ports, so the endpoint mapper hands out an address the firewall already allows.
This is done with two registry values, and the mistake everyone makes is setting only the first one.
# Static port for the directory service itself (NTDS): replication, DRS, SAM, LSA.
# HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters
# Value: TCP/IP Port Type: REG_DWORD Data: an available port
# Requires a reboot to take effect.
# Static port for the Netlogon RPC interface.
# HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters
# Value: DCTcpipPort Type: REG_DWORD Data: a DIFFERENT available port
# Requires only a restart of the Netlogon service.
DCTcpipPort alone produces an environment where logon works and half of everything else does not.
If you set both values to the same port, Netlogon logs error event 5809 to say the port is in use, and you should pick another. Confusingly, the same event is also logged harmlessly when you restart Netlogon on a correctly configured DC, because of how the RPC runtime hands over its server ports. On a healthy DC with two distinct ports configured, that one is noise.
DFSR needs pinning separately, because SYSVOL replication does not travel over the NTDS port:
# Pin DFS Replication to a single static RPC port on a named member.
# Omit /Member and dfsrdiag targets the local computer.
dfsrdiag StaticRPC /port:nnnnn /Member:dc02.corp.example.com
On current Windows Server builds the Set-DfsrServiceConfiguration cmdlet does the same job from PowerShell, and is the better choice if you are scripting the change across a set of DCs. Check the cmdlet’s own help for the parameter name on your build rather than assuming it matches the dfsrdiag switch.
You can also move the ephemeral range itself, which changes what the operating system allocates for outbound connections generally rather than pinning a specific service:
# Show the current dynamic port range for TCP and UDP.
netsh int ipv4 show dynamicport tcp
netsh int ipv4 show dynamicport udp
# Narrow the range to 1000 ports starting at 10000 (so 10000-10999).
# Minimum range is 255 ports; minimum start port is 1025.
netsh int ipv4 set dynamicport tcp start=10000 num=1000
netsh int ipv4 set dynamicport udp start=10000 num=1000
Where this bites: pinning is a supported configuration, not a free one. Microsoft has published fixes for long logon times and for replication failing with RPC errors after a static NTDS port was set, so a domain controller that is behind on patching is a poor candidate. Restricting the range too aggressively also risks port exhaustion on a busy DC — you have taken away sixteen thousand ephemeral sources and given back a few hundred. Pin the services, and leave the general dynamic range alone unless you have a measured reason.
Certificate Services (AD CS)
AD CS has two completely separate traffic patterns, and conflating them is why PKI firewall rules are so often wrong. Enrollment is RPC/DCOM. Revocation checking is plain HTTP. They travel different paths, and the second one is the one that silently destroys authentication.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 135 | TCP | Client → CA | RPC Endpoint Mapper | Entry point for the native enrollment protocol. |
| 49152-65535 | TCP | Client → CA | Dynamic RPC / DCOM | The actual certificate request and issuance. |
| 445 (and 139) | TCP | Client → CA | SMB | Used by CertSvc; 139 only where NetBIOS is still in play. |
| 443 | TCP | Client → web server | CA Web Enrollment (/certsrv) | HTTPS is mandatory; the pages refuse to work over HTTP. |
| 443 | TCP | Client → CES / CEP | Enrollment Web Services | WS-Trust over HTTPS, for non-domain or off-network clients. |
| 389 / 636 | TCP | CEP → DC | LDAP / LDAPS | The policy web service reads templates from AD. |
| 80 | TCP | Everything → CDP/AIA | CRL, delta CRL and AIA retrieval | Plain HTTP by design. Do not “helpfully” force it to HTTPS. |
| 80 | TCP | Everything → responder | OCSP (Online Responder) | Same reasoning as CRL distribution. |
| 80 / 443 | TCP | Device → NDES | Network Device Enrollment Service | SCEP enrollment for network devices and MDM. |
Revocation checking is the number one silent failure in a segmented PKI, and it is worth understanding why it is silent. When a client validates a certificate, it fetches the CRL from the URL baked into the certificate’s CDP extension. If that URL is unreachable, the client does not fail fast — it waits for a timeout, then treats revocation status as unknown. Depending on what is validating, that surfaces as a login that takes ninety seconds, an LDAPS bind that intermittently fails, a smart card that works in the office and not in the DMZ, or a service that starts fine and then stalls on its first outbound TLS handshake. Nothing in that list says “CRL”.
There is a related failure that looks like a firewall problem and is not: an expired domain controller certificate breaks LDAPS while leaving plain LDAP working, which is covered in LDAPS fails after the DC certificate expired. The broader PKI design is in the Active Directory Certificate Services post.
Configuration Manager (SCCM / MECM)
Configuration Manager has the largest port surface of anything covered here, because it is really a dozen role-to-role relationships rather than one product. The saving grace is that most client-facing traffic is HTTP or HTTPS on ports you can change.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 80 / 443 | TCP | Client → MP, DP, SMP, FSP | HTTP / HTTPS site system traffic | Configurable during setup or in site properties. |
| 10123 | TCP | Client → MP | Client notification | Default channel before falling back to HTTP/HTTPS. |
| 8005 | TCP | Client → DP | Express updates (delta content) | Set via client settings; alternate port available. |
| 8530 / 8531 | TCP | Client → SUP (WSUS) | Software updates | WSUS default since Server 2012. Was 80/443 before. |
| 3268 | TCP | Client → GC DC | Global Catalog LDAP | Skipped by workgroup and internet-only clients. |
| 389 / 636 / 3268 | TCP + UDP | Site server, MP → DC | LDAP, LDAPS, Global Catalog | Discovery and publishing to the AD system container. |
| 135 + dynamic | TCP | Site server ↔ site systems | RPC endpoint mapper and RPC | Bidirectional by default unless you force server-initiated. |
| 445 | TCP | Site server ↔ site systems | SMB | Also site-to-site: SMB 445 is the only port between site servers. |
| 1433 | TCP | Roles → SQL Server | SQL over TCP | Alternate port supported; named instances must be static. |
| 4022 | TCP | SQL → SQL | SQL Server Service Broker | Intersite database replication. Alternate port available. |
| 1434 | UDP | SQL → SQL | SQL Server Browser | Required with a named instance on a non-default port. |
| 67, 68 | UDP | Client ↔ PXE DP | DHCP for PXE boot | PXE on a DP, with or without WDS. |
| 69 | UDP | Client → PXE DP | TFTP | Listens on 69, responds from a dynamic high port. |
| 4011 | UDP | Client → PXE DP | BINL | The PXE negotiation layer proper. |
| 547 | UDP | Client → PXE DP | DHCPv6 | Only for the PXE responder without WDS. |
| 63000-64000 | UDP | DP → client | Multicast deployment | Only on a DP configured for multicast. |
| 2701 | TCP | Console → client | Remote Control | Remote Assistance uses 3389 instead. |
| 9 / 25536 | UDP | Client → client | Wake On LAN / wake-up proxy | Wake-up proxy also needs ICMP between peers. |
| 8003 / 8004 | TCP / UDP | Client ↔ client | Windows PE peer cache | 8004 UDP broadcast, 8003 TCP download. |
Two PXE traps are worth naming. TFTP listens on UDP 69 but replies from a dynamically allocated high port, so a stateless rule that only permits UDP 69 lets the request out and drops every reply. And during the actual PXE boot, the port the network card selects is chosen by the card’s firmware, not by Windows — it is bounded only by RFC 1350, meaning anything from 0 to 65535. PXE across a firewalled boundary is genuinely awkward, and a local DP in the segment is usually the honest answer.
Operations Manager (SCOM)
SCOM is refreshingly compact by comparison: agents talk to a management server on one port, and almost everything else is either SQL or a console.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 5723 | TCP | Agent → MS / GW | Agent to management server channel | The one port that matters. Configurable at setup. |
| 5723 | TCP | Gateway → MS | Gateway to management server | Gateways exist precisely to collapse DMZ rules to this. |
| 5724 | TCP | Console, web, reporting → MS | Operations console and SDK | Also needed MS to MS during install; can close afterwards. |
| 1433 / 1434 | TCP / UDP | MS → SQL | Operations and data warehouse databases | 1434 UDP is SQL Browser. Verify the real port in SQL config. |
| 135, 137, 445, 49152-65535 | TCP + UDP | MS → SQL | Setup-time SQL state validation | Only needed during management server installation. |
| 53, 88, 389 | TCP + UDP | MS / GW → DC | DNS, Kerberos, LDAP | Port 88 is unnecessary if you use certificate authentication only. |
| 135, 137, 138, 139, 445, 49152-65535 | TCP + UDP | MS / GW → target | Agent push installation | Push install is why “just 5723” is not enough on day one. |
| 161, 162 | UDP | MS ↔ network device | SNMP | Must be bidirectional, and ICMP with it. |
| 1270 | TCP | MS / GW → UNIX-Linux agent | Cross-platform monitoring | Note the direction: inbound to the monitored host. |
| 22 | TCP | MS / GW → UNIX-Linux host | SSH for agent install and upgrade | Needed only during agent lifecycle operations. |
| 51909 | TCP | ACS forwarder → collector | Audit Collection Services | Configurable via registry. |
The pattern to take away is that the steady-state agent requirement is a single outbound port, but the installation requirement is the full file-and-print and dynamic RPC set, because the management server pushes the agent using the same mechanisms as any other remote install. That is why so many DMZ SCOM deployments are described as “not working” when the agent was simply never installed. Deploy the agent manually with the MSI, and 5723 outbound is genuinely all you need afterwards.
One documented constraint to plan around: Operations Manager does not support LDAP over SSL, so do not build a rule set that assumes SCOM will reach a domain controller on 636.
CrowdStrike Falcon
Falcon is the section where the correct answer is much shorter than people expect, and getting it wrong costs you unnecessary exposure rather than a broken service.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 443 | TCP | Sensor → CrowdStrike cloud | Sensor telemetry and policy | TLS 1.2 or later. Outbound only. |
| — | — | Inbound | Nothing | No inbound listener is required on a sensor host. |
What does need care is the destination set. Falcon sensors connect to region-specific cloud endpoints — the ts01-*.cloudsink.net hosts and associated *.crowdstrike.com API endpoints — and the exact hostnames differ between US-1, US-2, EU-1 and GovCloud tenancies. Do not copy an allowlist from a blog post, including this one: the authoritative list lives in the CrowdStrike support portal for your tenant, and it changes. Take the hostnames from there.
On proxies: the sensor supports proxying, but if the proxy performs TLS inspection you need to exclude the CrowdStrike destinations from interception. The sensor validates the certificate chain it expects, and an inspecting proxy substitutes its own — which produces a sensor that installs cleanly, reports as installed locally, and never appears in the console. That specific failure mode is worth checking before anyone starts examining firewall logs.
Internal Web Applications and AD
An internal web application that uses Windows Authentication is not just an HTTP service. It is a Kerberos participant, and it needs a path to the directory that has nothing to do with the port users connect on.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 80 / 443 | TCP | User → web server | HTTP / HTTPS | The only port most people think about. |
| 88 | TCP + UDP | User → DC | Kerberos service ticket | The client gets the ticket, not the server. Easy to miss. |
| 88, 389, 135 + dynamic | TCP + UDP | Web server → DC | Delegation and identity lookups | Needed for constrained delegation and group checks. |
| 389 / 636 / 3268 / 3269 | TCP | App → DC | LDAP bind and directory queries | LDAP-bound apps; use the GC ports for forest-wide reads. |
| 443 | TCP | Client → WAP → AD FS | AD FS authentication | Required inbound on both firewall layers. |
| 49443 | TCP | Client → WAP | AD FS client certificate authentication | Only client-to-WAP, not WAP-to-federation-server. |
| App port | TCP | Load balancer → web server | Health probe | Frequently forgotten in a new segment. |
The row that catches people is Kerberos from the user to the domain controller. When a browser hits an intranet site configured for Windows Authentication, the client requests a service ticket for that site’s SPN from a DC and presents it to the web server. Put the users in a segment that cannot reach a DC on 88, and the site does not fail with an authentication error — it falls back to NTLM, or prompts for credentials repeatedly, which sends everyone hunting through IIS configuration for a problem that is on the network.
Constrained delegation adds a second hop with its own requirements. The web server itself must reach a domain controller to request a ticket on the user’s behalf, so the server segment needs Kerberos and LDAP outbound to a DC even though no user traffic goes that way. When delegation is configured correctly and still fails, the causes are usually SPN registration rather than ports — Kerberos constrained delegation not working works through that case in detail.
For AD FS, note the asymmetry in the 49443 rule. Client certificate authentication needs TCP 49443 inbound on the firewall between clients and the Web Application Proxy, but not on the firewall between the proxy and the federation servers. Microsoft also warns that no other service on those servers should be using 49443, which is worth checking on a shared host.
The Ports Everyone Forgets
These are the rules that get discovered three weeks after a segmentation project is declared complete, usually by someone who cannot print.
| Port | Protocol | Direction | Service / Purpose | Notes |
|---|---|---|---|---|
| 67 / 68 | UDP | Client ↔ DHCP server | DHCP | Across subnets this is an IP helper, not a firewall rule. |
| 647 | TCP | Server ↔ Server | DHCP failover | Between the two partners in a failover relationship. |
| 2535 | UDP | Client → DHCP server | MADCAP | Multicast address allocation. Rare, but documented. |
| 8530 / 8531 | TCP | Client → WSUS | Windows Update | Server 2012 defaults. Both must be open when using HTTPS. |
| 5985 / 5986 | TCP | Admin → target | WinRM 2.0 (HTTP / HTTPS) | PowerShell Remoting and Windows Event Forwarding. |
| 3389 | TCP + UDP | Admin → server | Remote Desktop | UDP is used for transport optimisation, not just TCP. |
| 137, 138, 139, 445 | TCP + UDP | Console → target | Classic remote Event Viewer | The Event Log service uses RPC over named pipes. |
| 135 + dynamic, 445 | TCP | Client → print server | Print Spooler | Spooler is RPC over named pipes plus RPC. |
| 515 | TCP | Client → print server | LPD | Only for the TCP/IP Print Server role. |
| 9100 | TCP | Print server → printer | Raw / JetDirect printing | Device convention, not a Windows service port. |
| 161 / 162 | UDP | Monitoring ↔ device | SNMP and SNMP traps | 161 queries in, 162 traps out. |
| 80 / 443 | TCP | Entra Connect → Entra ID | Directory synchronisation | 80 is for CRL retrieval, 443 for the sync itself. |
| 53, 88, 135, 389, 445, 636, 3268, 49152-65535 | TCP + UDP | Entra Connect → DC | On-premises AD read and password sync | Effectively a member server’s full port set. |
| 5985, 9389 | TCP | Entra Connect → DC | WinRM and AD Web Services | Only when installing AD FS with a gMSA via the wizard. |
Two honest caveats. Syslog is conventionally UDP 514, and TCP 514 or 6514 for TLS, but that is a protocol convention rather than a Microsoft service port — take the real value from your collector’s configuration. Backup agents are entirely vendor-specific and frequently use a control port plus a dynamically negotiated data channel; there is no useful generic answer, and guessing produces a rule that passes a firewall review and fails a restore. Get the port list from the vendor for the version you are running.
Windows Event Forwarding deserves a specific mention because its direction surprises people. In the common source-initiated setup, the forwarding computers connect outbound to the collector over WinRM, so the rule you need is from the monitored estate to the collector, not the reverse. If you have modelled it as a management tool reaching in, the rules will be backwards.
“Just Open Everything Between the DCs”
This request appears in every AD firewall project, usually from the AD team, and it is worth understanding why it is both reasonable and wrong.
It is reasonable because the dynamic RPC range genuinely is enormous, the interactions genuinely are complex, and a permit-any rule between two domain controllers does eliminate an entire class of tickets. Nobody asking for it is being lazy.
It is wrong because domain controllers are the highest-value target in the estate, and a permit-any rule between them means that an attacker who compromises one has unrestricted lateral movement to every other. It also destroys your ability to answer the question “what does this DC actually talk to?”, which you will want during an incident. And in practice it papers over the real problem: nobody documented what the environment needs, so the ruleset can never be reviewed or reduced.
What to offer instead, in the order network teams tend to accept it. Start with the fixed-port set — twelve well-known ports with a clear justification each, which is a rule sheet a security team can actually approve. Then handle the dynamic range by pinning NTDS, Netlogon and DFSR to specific static ports, which converts “sixteen thousand ports” into “three more ports”. Where the boundary is genuinely hostile, encapsulate the whole conversation: Microsoft’s documented alternative is IPsec, which reduces the firewall rule to ESP (IP protocol 50), ISAKMP on UDP 500, and NAT-T on UDP 4500 regardless of what is inside the tunnel.
Proving a Port Is Actually Open
A firewall rule existing and a port being reachable are different claims. These are the tools, roughly in order of how much they tell you.
# Cheapest check: is this single TCP port reachable from here?
Test-NetConnection -ComputerName dc02.corp.example.com -Port 389
# Ask the RPC endpoint mapper what it is actually advertising.
# Querying 135 with -e returns every endpoint currently registered.
portqry -n dc02.corp.example.com -e 135 -p tcp
# Probe a range. Note the separator is a colon, not a hyphen.
portqry -n dc02.corp.example.com -r 49152:49200 -p tcp
# Query several specific ports in one pass, in the order given.
portqry -n dc02.corp.example.com -p both -o 88,135,389,445,464
# Confirm the local dynamic port range matches what the firewall allows.
netsh int ipv4 show dynamicport tcp
# Is replication actually succeeding, and with which partners?
repadmin /showrepl
repadmin /replsummary
# Microsoft's own replication and connectivity tests.
dcdiag /test:replications
dcdiag /test:connectivity
# Which DC does this machine believe it should be using, and is the channel healthy?
nltest /dsgetdc:corp.example.com
nltest /sc_query:corp.example.com
LISTENING is a clean success. NOT LISTENING means the packet reached the host and was actively refused — the path is open, the service is not running. FILTERED means no answer came back at all, which is what a firewall drop looks like. Confusing the last two sends you to the wrong team.
The order matters. Test-NetConnection proves a single TCP path and nothing else. PortQry against 135 is the one that earns its keep on RPC problems, because it does not just test the port — it enumerates what the endpoint mapper is handing out, so you see the dynamic ports the service is genuinely using and can test those specifically. Then repadmin /showrepl tells you whether the directory agrees that any of it is working.
One documented quirk: a PortQry query to UDP 389 may not work correctly against modern domain controllers. Use nltest to check the DC locator service on UDP 389 rather than concluding the port is blocked.
When these tests point at RPC specifically, replication error 1722 walks through the full diagnosis, and Windows Firewall with Advanced Security covers the host-based half of the problem.
Gotchas That Cost You a Change Window
| Gotcha | What Happens | What To Do |
|---|---|---|
| Mixed OS versions | Server 2003-era hosts use ephemeral range 1025-5000; Server 2008 and later use 49152-65535. A rule for one breaks the other. | Where both eras coexist, open both ranges until the legacy hosts are gone. |
| Stale 5722 rules | DFSR used TCP 5722 on Server 2008 and 2008 R2 only. On 2012 and later it uses the dynamic range instead. | Remove the 5722 rule and confirm the dynamic range is genuinely permitted. |
| Host firewall vs network firewall | The network rule is approved, Windows Firewall still drops it, and the network team is blamed. | Test from the host with Test-NetConnection, then check the inbound rule on the destination. |
| NAT in the path | Kerberos tickets are bound to service principal names and addresses. Translating addresses between client and DC breaks authentication in ways that look like credential problems. | Do not NAT domain traffic. Route it, or tunnel it with IPsec. |
| Asymmetric routing | Request goes out one path, reply returns another. A stateful firewall sees a reply with no session and drops it. | Confirm both directions traverse the same firewall pair before blaming the port list. |
| Stateless UDP rules | TFTP listens on 69 and replies from a dynamic high port. A permit for UDP 69 alone silently drops every response. | Use a stateful rule, or place a distribution point inside the segment. |
| IPsec expected but not negotiated | Traffic encapsulated in ESP needs IP protocol 50, UDP 500 and UDP 4500. Miss those and nothing passes, whatever the inner ports say. | Permit the tunnel protocols explicitly. Packet filters for L2TP are not needed when ESP protects it. |
| Only 135 opened | The endpoint mapper answers, hands out a dynamic port, and the connection to that port is dropped. Looks like a working rule. | Open the dynamic range, or pin NTDS, Netlogon and DFSR to static ports. |
Final Thoughts
The reason AD firewall work is unpleasant is not that the port list is long. It is that the failures are asymmetric: nearly every missing rule produces a delayed, partial, or intermittent symptom rather than a clean error. Group Policy goes stale. Password changes fail while logon works. A certificate validates in one segment and hangs in another. By the time anyone reports it, the change that caused it is weeks old and off the suspect list.
The defence is to treat the port list as documentation of what the environment actually does, rather than as a request form. Write down which host needs to reach which host and why. Pin the RPC services so the dynamic range stops being the whole conversation. Prove reachability with PortQry and repadmin rather than trusting the rule sheet. Then the next segmentation project starts from a list instead of an argument.
portqry -n <dc> -e 135 to see what the endpoint mapper is really advertising, and confirm with repadmin /showrepl that the directory agrees.
Next, we can cover the other half of this problem: designing AD Sites and Services so that replication traffic follows the links you intended, and clients pick a domain controller in their own site rather than one across a WAN.