The Microsoft Systems Management Server 2003 (SMS 2003) Operating System Deployment Feature Pack (OSD) provides a number of program-specific phases, or points in the OS deployment process where you can configure actions that the OSD will perform. For every phase, except Install, you can also specify one or more custom actions, such as running a script. Web Table 1 lists the phases, whether they're related to a new OS installation or an OS upgrade, and the default actions you can configure. You configure these phases under the OS program properties' Advanced tab in the Microsoft Management Console (MMC) SMS Administrator snap-in.

The custom-actions capability makes OSD's phases especially powerful. For example, for one customer who wanted static IP addresses on the SMS client machines, I simply wrote a 40-line VBScript script, invoked during the State Restore phase, that used a Windows Management Instrumentation (WMI) call to read a computer's serial number, connected to a Microsoft SQL Server database, read that computer's IP address from the database, and configured the IP address on the machine via calls to the Netsh utility. Anything you can script can be implemented as part of an OSD deployment, making it a totally hands-off, flexible technology. One caveat: As I mentioned in the main article, the default Microsoft Windows Preinstallation Environment (WinPE) that comes with OSD is scaled down and doesn't have WMI support. To get the most out of the OSD, you'll need to replace its WinPE with your own WinPE 2004 environment, which has full WMI, Windows Script Host (WSH), and ADO support.

You can also use a script to automate the selection of the OS to be installed and specify this script when you create the installation CD. Here are a few examples of script logic that could perform this function:

  • Use WMI calls to ascertain a computer's make and model, number of processors, memory, and other information, then, based on this information, select the correct OS to install (e.g., if it's a server with more than four processors, select the Windows Server 2003 Enterprise Edition OS image).
  • Use a WMI call to ascertain a computer's serial number or MAC address, then connect to a SQL Server database to read the configuration that's been assigned for this machine.
  • As a modification to the previous examples: If the machine doesn't find the required machine-specific information, it writes an empty record, then sleeps for 30 minutes and checks again. I wrote a small Active Server Pages (ASP) page as an interface to the database, and when the administrator sees a new machine with new OS assigned, the admin simply selects from a drop-down menu the OS needed for that machine.