Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I want to install the SMTP service for IIS 6 on windows server 2003. The GUI process is explained here on technet. Then I want to configure the properties (e.g. first retry interval) and create new domains etc.

Can I script this using powershell (or any other scrpting for that matter). If yes can you point me to some resources or even give me some script samples to get me started.

share|improve this question
Did this answer your question? If so please mark as answered. – Bernie White Oct 13 '14 at 1:20

Under new version of Windows such as Windows 2008 and Windows 2012 there is a built in cmdlet that directly handles this function called Add-WindowsFeature.

Under Windows 2003 or Windows XP, the way to do it is through an answer file and calling Sysocmgr.exe which is responsible for adding an removing windows components. See

So you would create an answer file like:


Then call this from the command line from PowerShell by: Invoke-Expression "$env:windir\system32\sysocmgr.exe /r /q /i:$env:windir\inf\sysoc.inf /u:c:\TEMP\answerfile.txt”

Note that IIS must already be installed. If it is not, add iis_common=on to answer file too.

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.