Scripting - Using telnet through command line or PowerShell

Other than using telnet with this syntax (it is required to install Telnet Client on device using add/remove program or alternative ways)

telnet IP/hostname port_number

telnet 192.168.100.2 443

otherwise you can utilize powershell too with this syntax

PS C:\> Test-NetConnection

or PS C:\> tnc

Example 1: Test ping connectivity

PS C:\> Test-NetConnection

Example 2: Test ping connectivity with detailed results

PS C:\> Test-NetConnection -Port 80 -InformationLevel "Detailed"

Example 3: Test TCP connectivity and display detailed results

PS C:\> Test-NetConnection -ComputerName ayampenyet.com -Port 443

Example 6: Perform route diagnostics to connect to a remote host with routing constraints

PS C:\> Test-NetConnection -ComputerName "www.contoso.com" -ConstrainInterface 5 -DiagnoseRouting -InformationLevel "Detailed"

more examples coud be found here

https://learn.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection?view=windowsserver2022-ps