1 min read

ConfigMgr - Test cm client port communications

ConfigMgr - Test cm client port communications

A quick script you can use to test communication between client and server over some typical CM ports.
I also use it from "Run Script" (obviously it wont work if BGB channel isn't available tho).

Param(
	[Parameter(Mandatory = $True, HelpMessage = "Supply IP or FQDN to the server you want to test communication")]
    [ValidateNotNullOrEmpty()]
    [string]$Server
)

$Ports = @(
    "80", `
    "443", `
    "445", `
    "10123", `
    "8005", `
    "8530", `
    "8531"
)

Foreach($Port in $Ports){
	Try{
    	$NetSocket = New-Object Net.Sockets.TCPClient
        $NetSocket.Connect($Server,$Port)
        $TestPort = $NetSocket.Connected
        If($TestPort -eq $true){
        	Write-Output "Communication from $env:COMPUTERNAME --> $Server over $Port - OK."
        }
    }Catch{
    	Write-Output "Communication from $env:COMPUTERNAME --> $Server over $Port - FAILED."
    }
}