PowerShell implementation Telnet Port

Source: Internet
Author: User

Telnet Port Script

1 $servers= get-content D:\ps\ServerIPAddress.TXT2 $portToCheck= ' 80'3  for($i= 1;$i -le120;$i++)4 {5 foreach($server inch $servers) {6  7     If(test-connection$server-count 1-Quiet) {8     9 try {Ten             $null= New-object System.net.sockets.tcpclient-argumentlist$server,$portToCheck One             $props= @{ AServer =$server -PortOpen =' Yes ' -date=get-Date the             } -         } -   - Catch { +             $props= @{ -Server =$server +PortOpen =' No ' Adate=get-Date at             } -         } -     } -   -     Else { -          in         $props= @{ -Server =$server toPortOpen =' Server did not respond to ping ' +date=get-Date -         } the     } *   $New-object Psobject-property$props| Out-file-append D:\PS\test-Telnet.csvPanax Notoginseng } -Start-sleep-s 10 the}
View Code

PowerShell implementation Telnet Port

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.