Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.