Skip to content

Instantly share code, notes, and snippets.

@fabiocruzcoelho
Last active April 10, 2018 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiocruzcoelho/a63bf5204d897b4fcfce3b1c2b503154 to your computer and use it in GitHub Desktop.
Save fabiocruzcoelho/a63bf5204d897b4fcfce3b1c2b503154 to your computer and use it in GitHub Desktop.
gc D:\list.txt |test-NetConnection -port 53
Test-PortConnection -Destination DC01 -Ports 363
Test-PortConnection -Destination DC01 -Ports 363,80,1433
Test-PortConnection -Destination DC01,DC02 -Ports 363,80,1433
Test-PortConnection -Destination DC01,DC02 -Ports 363,80 | Export-Csv -Path C:\users\$env:username\desktop\results.csv -NoTypeInformation # Save it to CSV file on your desktop
Test-PortConnection -Destination (GC "C:\Temp\Servers.txt") -Ports 363,80,1433
Test-PortConnection -Destination (GC "C:\Temp\Servers.txt") -Ports 363,80,1433 | Out-GridView -Title "Results" # Display in new pop-up window
https://sid-500.com/2018/02/02/powershell-test-open-tcp-ports-with-test-openport-multiple-hosts-multiple-port-numbers/
http://www.powershellbros.com/test-connection-to-servers-on-several-ports/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment