In this article, we will learn how to enable telnet in Windows Server 2016 and Windows Server 2019 to fix “telnet is not recognized as an internal or external command, operable program or batch file.
- 1 telnet is not recognized as an internal or external command,
- 2 How to Enable Telnet Client in Windows Server 2016?
You might also like to How to Check SQL Server Connectivity between Application Server and Database Server.
telnet is not recognized as an internal or external command,
When I tried to check the connectivity between two servers from SharePoint Server to Exchange server on port 25 using telnet command, I got the below error.
telnet is not recognized as an internal or external command, operable program or batch file.
Why the telnet is not recognized Windows Server 2016?
Actually, we got the “telnet is not recognized as an internal or external command” error because the Telnet Client feature is not installed on the Windows Server 2016.
How to Enable Telnet Client in Windows Server 2016?
Before we get started to fix the “telnet is not recognized” issue, let us first define What’s Telnet Client?
What’s Telnet Client?
The telnet stands for “Telecommunication network“, it’s a network protocol that used to access a remote computer over the TCP/IP network or over the internet.
As administrators, we mostly use the Telnet command to check the connectivity between two servers within the same network, we specifically check the port status (Opened or closed) on the destination server. so if the port is opened, the source server can connect to the destination server. Read more at Microsoft Docs.
So that, to install and enable Telnet Client feature in Windows Server 2016 / 2012, you should follow the below steps:
- Open Server Manager > Manage > Add Roles and Features.
- Continue clicking on Next button until reaching to Features section.
- Scroll down to finding Telnet Client > Check it.
- Click Next > Click Install.
- Wait a moment until the feature installation has finished > Click close.
Verity and Test Telnet Client
To make sure that the Telnet Client feature has been enabled and installed properly in Windows Server 2016 / 2012, you should do the following:
- Open the command prompt as administrator > Type the following Telnet command.
telnet [Exchange Server FQDN or IP] [Port] Ex: telnet dc 25
- If the port is opened, you should get the below message that means SharePoint Server can connect to the SMTP server on port 25
You might also like to read Exit Telnet Session
- Otherwise, you will get the below message that means the specified port is closed, and you could not open connection to the host.
In this case, you should check with your Security/Network administrator the below points:
- What’s the IP or FQDN for SMTP Server?
- What’s the assigned port for the SMTP server? (the default port is 25).
- On your server, the ports might be blocked by a firewall or antivirus settings. thence, you should redefine the inbound and outbound rules related to SMTP.
How to Enable Telnet using PowerShell?
Besides, enabling Telnet Client through Server Manager, you can easily and quickly install a new windows feature through PowerShell by doing the following:
- Open Windows PowerShell as Administrator.
- Run the below command line
Install-WindowsFeature -name Telnet-Client
How to install Telnet Client Online using Command-Line?
To install Telnet Client windows feature, you can also use command line as the following:
- Open Command Prompt as Administrator.
- Run the below command line to install Telnet Client Online.
dism /online /Enable-Feature /FeatureName:TelnetClient
You might also like to read how to Install .NET Framework 3.5 on Windows Server 2016
To be able to use the Telnet command line, and avoid “telnet is not recognized as an internal or external command, operable program or batch file“. you must first install Telnet Client as a feature in Windows Server.
Here, we have learned, how to enable telnet client feature in Windows Server 2016 and 2012 through Server Manager, PowerShell, and CMD.
- Windows Server 2019.
- Windows Server 2016.
- Windows Server 2012.
- Windows Server 2008.