Test-NetConnection vs Test-TcpConnection
Closed this issue · 1 comments
jdhitsolutions commented
I'm curious about the advantages of using your Test-TcpConnection
command over Test-NetConnection
. I like that your command lets me test multiple ports, but is there anything else? I'd put this information in the help and your readme file.
anthonyg-1 commented
Will add that reasoning to both the readme and help for the function
itself. In short:
1. Single host, multiple ports (port scan)
2. Multiple hosts, multiple ports
3. Speed: ability to reduce default timeout on scans
4. Takes pipeline input from Get-ADComputer and sends output to
Get-TlsCertificate (also contained within that module). Example (will be adding this to the help and readme):
# Get all Server 2019 instances from Active Directory and determine which ones are listening on port 443:
Get-ADComputer -Filter {OperatingSystem -like "*2019*"} | Test-TcpConnection -Port 443 -Timeout 100 | Where Connected`
# Get an expiration report of LDAPS certificates from Active Directory domain controllers:
Get-ADDomainController -Filter * | Test-TcpConnection -Port 636 | Where Connected | Get-TlsCertificate | Select Subject, NotAfter
There's likely more but that's off the top of my my head. I'll document
them as I remember.
…On Tue, May 9, 2023 at 9:09 AM Jeff Hicks ***@***.***> wrote:
I'm curious about the advantages of using your Test-TcpConnection command
over Test-NetConnection. I like that your command lets me test multiple
ports, but is there anything else? I'd put this information in the help and
your readme file.
—
Reply to this email directly, view it on GitHub
<#4>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHGBZJQL4RVCNCBI3GRYP5TXFI6ZFANCNFSM6AAAAAAX3IPD7U>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>