[B] [U]CONFIGURING ROLES[/U][/B]
There are two commands to use when dealing with server roles: [B]oclist[/B] and [B]ocsetup[/B]. Later, we will look at the new [B]dism.exe[/B] If you type oclist, you will get a list of all the roles and their optional components. The list is pretty lengthy, so I like to use the [B]find[/B] command to narrow my results. For example, if we wanted to add the DHCP server role, I would check for the precise name of the role by typing:
oclist | find /i "dhcp"
Results:
Not Installed: DHCPServerCore
Now I know the role name is specifically DHCPServerCore and that it is in fact not installed. So, we install the role by typing:
ocsetup DHCPServerCore
Note that the above server role IS case sensitive. If I use oclist again to check for DHCP, I now see the following:
oclist | find /i "dhcp"
Results:
Installed: DHCPServerCore
If I wanted to remove the role, I’d use the uninstall switch with ocsetup:
ocsetup DHCPServerCore /uninstall
Pretty straight forward. Now, with R2, there is a new CLI tool called [B]dism.exe[/B]. This tool can also configure server roles, but it does much more. For now, we will use it to configure roles like we did with ocsetup/oclist.
To get a list of roles (called features in dism):
dism /online /get-features
Let’s add that DHCPServerCore feature using dism:
dism /online /enable-feature /featurename:DHCPServerCore
And then to remove it:
dism /online /disable-feature /featurename:DHCPServerCore
So, what is the big deal? Same results as ocsetup, but, dism will replace it because it goes further than just toggling features. It will service WIM and VHD image files, allowing add/remove of drivers and features, especially useful if your server has the role of deploying images or runs Hyper-V.