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.

  • 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 http://support.microsoft.com/kb/222444

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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