Package Manager Command-Line
Installing a Web server on Windows Server 2008 from a script.
You can usually add features through the Windows Server 2008 Server Manager snap-in via a script. In the case of IIS 7.0, there are many options available for the feature install.
One way to ensure a consistent configuration for applications that require IIS (e.g., SQL Server) is to use a scripted installation. For IIS, the package manager can install the features locally. To install a basic IIS configuration, run the following script:
start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServerManagementTools;
IIS-ManagementService;IIS-Metabase;WAS-WindowsActivationService;
WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI
The command provides little interaction and, by default, does not provide feedback of any type if an incorrect parameter is passed after the /iu parameter.
Once the scripted task completes after a minute or so, and the Window Server 2008 Server Manager snap-in performs its next refresh, the Web server is listed as a role on the system and is running.
Using this scripted install of IIS is a good way to ensure consistent server build configurations, and other Windows features can be automated through the package manager (pkgmgr). The package manager can also uninstall packages, which may be helpful for temporarily enabling a feature for a specified amount of time and for removing the feature from a scheduled task to ensure its decommissioning.
Filed Under: Uncategorized