In Windows 2008 Components like IIS, DNS etc. are called as Roles and you can add these Roles from Server Manager >> Roles >> Add Roles and then you have to follow the steps to install the desire components. This process is a bit lengthly as you will have to go through the steps. You can automate and eliminate these steps by using Command Line utility called “ServerManagerCmd.exe”.
ServerManagerCmd.exe is a tool or command which Installs and removes roles, role services and features. Also displays the list of all roles, role services, and features available, and shows which are installed on this computer.
-help | -?
“-query” parameter is used to see all the available and installed ROLES of components on the server. The installed modules are are shown in Green Color (which can bee seen in below image)
To add additional roles to the server, “-install” or “-i” parameter is used. You can install a ROLE by using “-i” which will install all the components which are required by the component.
Also you can mentioned all the Components separating them with SPACE which will install all the modules you have listed (it will save time)
You can find more information about the ROLES and “Command value” (Component name) on Microsoft Technet Website
Roles which are already installed on the server can be removed with the help of “-remove” parameter. Using this, complete ROLE and it’s dependencies will be un-installed from the server.
This parameter is used to check the ServerManager version
-help or -?
Display Help for ServerManagerCmd.exe in the command window.
NOTE: There are some roles which requires Reboot after installation or removal, in such cases you can add “-restart” at the end of install or remove option. This will reboot the server after completion of task if required.
C:>servermanagercmd -remove Web-Server -restart