One important aspect of automating Windows deployment and setup is enabling particular roles on Server systems. For example, enabling the SMTP/POP service for email. On Server 2008/R2 this is really easy using servermanagercmd.exe and passing through a list of the features/roles you want to install. For 2003 this is a little more complex, requiring the use of the sysocmgr.exe tool.
This tool works on .inf files. Running the command:
Will open up the usual “Windows Components Wizard” part of windows setup (as if you went to Add/Remove programs and clicked on Add/Remove windows components). You can automate which bits of Windows are added/removed by specifying an unattend file with the /u switch, e.g.:
sysocmgr /i:%windir%\inf\sysoc.inf /u:C:\ocm.txt
The answer file then specifies which components you want to add/remove, e.g. to add the POP3/SMTP service:
Pop3Srv = On
Pop3Service = On
Pop3Admin = On
The %windir%\inf\sysoc.inf file contains a roughly complete list of these components, and there’s another listing of them here.
Further flags can be used to refine the process, e.g.:
/r - suppress reboot
/x - suppress init banner
/q - run without UI (useful with /u)
/w - prompt before reboot if using /u
/c - disallow cancel
For a complete list do “sysocmgr /?” on a Server 2003 R2 system.
As an aside, configuring the POP3/SMTP server with a new domain requires the following command:
winpop add somedomain.com
The winpop command can be used to query and control the POP3/SMTP server service as well.