PS script to test many remote hosts and open ports

New to PS. Came across the following sample but how would i add multiple remote host ip address and different ports to test whether the ports are open?

Test-NetConnection -ComputerName 192.168.1.30 -Port 1433

I wish to test multiple remote hosts and different ports:

Example: Hosts in these ranges

192.168.1.25-29

192.168.1.40-50

Check whether these ports are open to the above hosts:

3389, 80, 443, etc. etc.

Appreciate any info or point me to correct site.

submitted by /u/kryp2nyght
[link] [comments]

Leave a Reply