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.
command-line-interfacepowershellwindows-server-2012
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.
Best Answer
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
To install it use
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