Submit a ticketCall us

Have You Auto Renewed? If not, you're missing out.
The SolarWinds Renewal Program comes with a host of benefits including the most recent product updates, 24/7 technical support, virtual instructor-led training and more. Experience all of this with the convenience of Auto Renewal, and never worry about missing any of these great benefits. Learn More.

Home > Success Center > Orion Platform > Use PowerShell to test that a port is open on a server

Use PowerShell to test that a port is open on a server

Table of contents

Updated: 10/5/2017

Overview

How to test that a specific ports is open without using telnet.

Environment

  • All modules
  • All Windows Server versions

Steps

1. Use the script bellow to check if the port is open.

2. Replace IP_Address_Server with the address of the server you are interested in.

3. Replace port with the port to check (e.g. 17777).

4. Save this script in a text file as porttest.ps1 and run in PowerShell.

$ipaddress = IP_Address_Server
$port = port
$connection = New-Object System.Net.Sockets.TcpClient($ipaddress, $port)
if ($connection.Connected) {
    Write-Host "Success"
}
else {
    Write-Host "Failed"
}

 

Last modified

Tags

Classifications

Public