Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are using servermanager.exe to install smtp server in windows 2008R2 from comand prompt. Is there any alternate to servermanager.exe? How to enable smtp server in windows 2012 from command prompt?

Thanks in Advance.

share|improve this question

Ok, checking, adding and removing Windows components like this from the command line can be done via the powershell commands get-WindowsFeature, install-WindowsFeature, and to remove the feature afterwards remove-WindowsFeature.

To see if SMTP server is installed already use

get-WindowsFeature smtp-server

To install it use

install-WindowsFeature smtp-server

If you want a bit of re-usable code you can use everywhere to check if the SMTP server is already installed, and if not then install it then something like this ought to do it

smtp = get-WindowsFeature smtp-server
 if (!smtp.Installed) {
  $smtp | add-WindowsFeature
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.