Install Telnet client on Server 2012 via PowerShell

20160614150939Every time I try to open the Telnet client on a new server I get a response stating that telnet is not recognized as an internal or external command, operable program or batch file. Meaning it isn’t installed, because the Telnet client is not installed by default. Installing it via the GUI is a hassle so instead we can do it via PowerShell.

To install the Telnet client on Server 2012 via PowerShell perform the following steps:

1. Open Powershell.
2. Run the command install-windowsfeature “telnet-client” per the below:

20160229140658

And that’s it, no need to even reboot :)

The Telnet client is now ready and waiting for some command line action.

Send email to multiple recipients using Send-MailMessage in PowerShell

To send a quick message using Send-MailMessage in PowerShell  to multiple recipients use the example below:

PS C:\Users\admin>Send-MailMessage -SMTPServer smtp.vsysad.com -To "Recipient 1 <recipient1@domain.com>", "Recipient 2 <recipient2@domain.com>" -From blog@vsysad.com -Subject "This is a test email" -Body "Hi Japinator, this is a test email sent via PowerShell"

The command sends the message though an SMTP Server, in the example above, it is smtp.vsysad.com.

If your server requires authentication add the -Credentials parameter:

PS C:\Users\admin>Send-MailMessage -SMTPServer smtp.vsysad.com -Credentials (Get-Credential) -To "Recipient 1 <recipient1@domain.com>", "Recipient 2 <recipient2@domain.com>" -From blog@vsysad.com -Subject "This is a test email" -Body "Hi Japinator, this is a test email sent via PowerShell"

There are loads more examples at this link.

Reference(s):
Send-MailMessage parameters and examples