https://github.com/asheroto/isportactive
Check if a port is actively listening or in use.
https://github.com/asheroto/isportactive
active check listening name network networking port powershell powershell-script process process-id process-name program windows
Last synced: 6 months ago
JSON representation
Check if a port is actively listening or in use.
- Host: GitHub
- URL: https://github.com/asheroto/isportactive
- Owner: asheroto
- License: gpl-3.0
- Created: 2023-05-19T19:21:55.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T06:10:40.000Z (over 2 years ago)
- Last Synced: 2025-07-29T16:19:56.166Z (7 months ago)
- Topics: active, check, listening, name, network, networking, port, powershell, powershell-script, process, process-id, process-name, program, windows
- Language: PowerShell
- Homepage: https://bit.ly/IsPortActive
- Size: 36.1 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://github.com/asheroto/IsPortActive/releases)
[](https://github.com/asheroto/IsPortActive/releases)
[](https://github.com/sponsors/asheroto)
[](https://ko-fi.com/asheroto)
# IsPortActive
This script checks if a port is currently active or in use. It can check for active TCP and UDP connections on a specified port, by process name, or by process ID.
If the process name is `svchost`, the script will find the service and display name in addition to the process name.
# Requirements
- PowerShell 7+
## Installing
You can either download the PS1 script from here, or install using...
```powershell
Install-Script IsPortActive -Force
```
Answer **Yes** to any prompts. `-Force` is optional, but it will force the script to update if it is outdated.
This script is published on [PowerShell Gallery](https://www.powershellgallery.com/packages/IsPortActive).
## Usage
```plaintext
IsPortActive [-Port ] [-ProcessName ] [-ProcessId ] [-Version] [-Help] [-CheckForUpdate]
```
## Parameters
Only one of the following parameters can be used at a time.
| Parameter | Description |
| --- | --- |
| `-Port` | Specifies the port number to check for active connections. |
| `-ProcessName` | Specifies the name of the process to check for active connections. |
| `-ProcessId` | Specifies the process ID to check for active connections. |
| `-Version` | Displays the version of the script. |
| `-Help` | Displays the help information for the script. |
| `-CheckForUpdate` | Checks for updates of the script. |
## Examples
| Description | Command |
| --- | --- |
| Check if port 443 is active | `IsPortActive -Port 443` |
| Check what ports are being used by process `httpd` | `IsPortActive -ProcessName "httpd"` |
| Check what ports are being used by process ID `1234` | `IsPortActive -ProcessId 1234` |
## Screenshots
### Check Port

### Check Process Name

### Check Process ID
