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

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 at 1:20

1 Answer 1

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:

[Components]
iis_smtp=on

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

 
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.