Submit a ticketCall us

AnnouncementsWeb Help Desk Integrations eCourse

Looking to reduce response times? Sign up for our eCourse to learn how integrating Web Help Desk with Dameware Remote Support, Network Configuration Manager, Network Performance Monitor, and Server & Application Monitor can improve communication efficiencies.

Register here.

Home > Success Center > Orion Platform > Orion - Knowledgebase Articles > 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