Install SMTP Server and Telnet with PowerShell

Summary

SharePoint and general app servers often use the SMTP Service to integrate e-mail into the systems functionality. Since Windows supports a well vetted SMTP Service, using the built-in application is often the best choice. With the said, when testing your app functionality with e-mail, Telnet is almost always needed and not installed by default.

If find yourself always rebuilding servers to test new features and functionality, you may install SMTP and Telnet manually each time. If this is the case, why not use PowerShell?

What does the script do?

If SMTP is not installed, the installation will proceed. Once completed, it will then detect if Telnet is already installed. If not, you will be asked if Telnet should be installed. If you run the script a server with SMTP or Telnet already installed, the app installation will be detected and skipped.

I’m hoping this script will make your test builds quicker and more enjoyable in the future.

The Script:

The Output:

Here is what you will see if SMTP and Telnet is not installed:

Windows Popup asking if Telnet should be installed:

Installing Telnet:

Done:

If SMTP and Telnet is already installed it be detected and skip the installation:

Leave a Reply