Configure Server Roles
To configure one or more Server Roles during an unattended installation, use the Server Manager command line tool.
You can create a FirstLogonCommand in your answer file that specifies the proper parameters for the server role you want to configure. The FirstLogonCommand runs during the oobeSystem configuration pass.
For more information about adding a FirstLogonCommand, see Add a Custom Command to an Answer File.
Note
Server Manager commands must be run from an account with administrator privileges.
For more information, see this topic about the Server Manager Command-Line Tool.
The following example shows the ServerManagerCmd.exe syntax for installing Web Server (IIS) and all its role services.
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>ServerManagerCmd.exe -install Web-Server -allSubFeatures -resultPath %SYSTEMDRIVE%\Admin\WebServer.xml -restart</CommandLine>
<Description>Configure Web Server Role</Description>
</SynchronousCommand>
</FirstLogonCommands>
Note
Not all server roles support Sysprep. Some server roles must be configured after imaging and deployment. For more information, see Sysprep Support for Server Roles.