Get-NetTCPConnection not reporting ports correctly #3277
Labels
issue-doc-bug
Something is out of date, unclear, confusing, or broken in the article. Blocks customer success.
needs-triage
Waiting - Needs triage
Prerequisites
Get-Foo
cmdlet" instead of "Typo."Links
https://github.com/MicrosoftDocs/windows-powershell-docs/blob/main/docset/winserver2016-ps/nettcpip/Get-NetTCPConnection.md
Summary
Running Get-NetTCPConnection not reporting all ports correctly. Found 2 machines that report that ports 80 and 443 are only listening on IPv6 when they are in fact listening on IPv4 and IPv6. This was confirmed by bindings in IIS and netstat.
Details
I am using this to test ports on a webserver automatically.
Running
netstat -ano | findstr /i ":80 :443" | findstr /i listening | findstr /v "::"
reports that the ports are open for IPv4 - this is correctWhen running
get-nettcpconnection | where {$_.localport -eq "80" -or $_.localport -eq "443" -and $_.state -eq "Listen"}
reports only the IPv6 ports are open.I have verified these results by running
get-nettcpconnection | where {$_.state -eq "listen"} | sort localport
port 135 is reporting for IPv4 and IPv6 but 80 and 443 dont.
Suggested Fix
No response
The text was updated successfully, but these errors were encountered: