One of the most powerful features in MDT is the option of having the Task Sequence install all the Roles and Features needed, most often on servers, but also for clients. I use this feature heavily in different kinds of automated datacenter builds and when preparing Proof-Of-Concept or other demo/lab type environments.
To use it, simply add the Install Roles and Features action to your Task Sequence. If you are using the default task sequence templates you would normally add it into the restore phase, but it can really be added at any time when the full operating system is up and running.
How does Install Roles and Feature action work?
Depending on target operating system the ZTIOSRole.wsf script does things a bit differently
- Windows Server 2003 – ZTIOSRole.wsf creates an answer file for sysocmgr.exe and then starts sysocmgr.exe with that answer file
- Windows Server 2008/2008R2 (not core editions) – ZTIOSRole.wsf creates an answer file for servermanagercmd.exe and then starts servermanagercmd.exe with that answer file
- Windows Server 2008/2008R2 core editions – ZTIOSRole.wsf calls ocsetup.exe directly
- Windows 7 – ZTIOSRole.wsf calls dism.exe directly
Explanation of the (Win7), (2008R2) and (Win7,Core) entries
In the Install Roles and Features action you will see various comments after some of the roles, role services and features. Here is what they really mean.
- (Win7) – The role/feature is available for Windows 7 and Windows Server 2008 R2, but not Core editions.
- (Win7,2008R2) – Same as above 🙂
- (2008R2) – The role/feature is available only for Windows Server 2008 R2 , but not Core editions
- (Core) – The role/feature is available only for Windows Server 2008 R2, including core editions
- (Win7,Core) – The role/feature is available for Windows 7 and Windows Server 2008 R2, including Core editions.
Roles for Windows Server 2003
The following roles are supported for Windows Server 2003
- IIS server
- Teminal Server
- Windows Deployment Services
Windows Server 2008 considerations
Please be aware of that not all roles (like File-Service) are available to be installed via ServerManagerCmd.exe (which MDT is using) in Windows Server 2008, they are only available in Windows Server 2008 R2. However, if you select a role service that is using that role it will be automatically added. As an example, to install the File Services role for Windows Server 2008 (not R2), only select the "File Server (Core)" role service under the "File Service" node in the Install Roles and Features, do not check the "File Service" node.
Sample for installing the File-Services role in Windows Server 2008, note that the File Servcies node is not selected
As always, check the logs. The script performing the Install Roles and Features action is the ZTIOSRole.wsf script, so you can either look in the ZTIOSRole.log directly, or in the BDD.log, in the ZTIOSRole section. During deployment these files will be in C:\MININT\SMSOSD\OSDLOGS and after deployment is completed you will find them in C:\Windows\Temp\DeploymentLogs.
You will also want to review the Roles.xml and ServerMgr.log files in the %Temp% directory.