1. Using dism to Add Roles to Windows Server 2008 R2
Windows Server 2008 R2 uses dism instead of ocsetup to add additional roles. The basic syntax is
dism /online /enable-feature /featurename: feature-name
For a full list of roles and features you can add, use the following command:
dism /online /get-features /format:table
Note
dism is not
available on the Windows Server 2008 Server Core installation. However,
it is available by default on Windows Server 2008 R2 and Windows Server
2008 R2 Server Core installations.
Tip
The feature-name must be entered using the exact case as shown in the get-features output. This is one of the few times when upper- and lowercase matters with the command prompt (just as it matters with the ocsetup command used with Windows Server 2008 Server Core).
Some roles require additional steps to configure. The following sections show how to add and configure various roles.
Adding the DHCP Server Role with dism
The following table shows the syntax to add the DHCP role.
Commands for DHCP | Comments |
---|
C:\>dism /online /enable-feature /featurename: DHCPServerCore
| Adds the DHCP role. |
C:\>sc config dhcpserver start= auto
| Configures the DHCP Server service to start automatically. |
| Starts the DHCP Server service.
Tip
After the DHCP Server role is added and the DHCP Server service is
started, you can configure DHCP remotely using a DHCP console on a
different system.
|
C:\>dism /online /disable-feature /featurename: DHCPServerCore
| Removes the DHCP role. |
Adding the DNS Server Role with dism
The following table shows the syntax to add the DNS role.
Commands for DNS | Comments |
---|
C:\>dism /online /enable- feature /featurename: DNS-Server-Core-Role
| Adds the DNS role.
Tip
After the DNS Server role is added, you can configure it remotely using a DNS console on a different system.
|
C:\>dism /online /disable- feature /featurename: DNS-Server-Core-Role
| Removes the DNS role. |
Adding File Services with dism
The following table shows the syntax to add the various file services.
Note
When you add any of the file services, the server is configured as a File Server.
Commands for File Services | Comments |
---|
C:\>dism /online /enable-feature /featurename:FRS-infrastructure
| Adds the File Replication service. |
C:\>dism /online /enable-feature /featurename:DFSN-Server
| Adds the Distributed File System service. |
C:\>dism /online /enable-feature /featurename:ClientForNFS-Base
| Adds the Distributed File System Replication service. |
C:\>dism /online /enable-feature /featurename:ServerForNFS-Base
| Adds Base Services for NFS. |
C:\>dism /online /enable-feature /featurename:ClientForNFS-Client
| Adds Client Services for NFS. |
Adding the Print and Document Services Role with dism
The following table shows the syntax to add the Print and Document Services role.
Commands for Print Services | Comments |
---|
C:\>dism /online /enable-feature /featurename:Printing-ServerCore-Role
| Adds the Print Services role. |
C:\>dism /online /enable-feature /featurename:Printing-ServerCore-Role-WOW64
| Adds 32-bit Print Server support. |
C:\>dism /online /enable-feature /featurename:Printing-LPDPrint-Service
| Adds the LPD service. |
Adding the AD CS Role with dism
The following table shows the syntax to add and remove the AD CS role.
Commands to Add PowerShell | Comments |
---|
C:\>dism /online /enable-feature /featurename:Certificate Services
| Installs the AD CS role. |
C:\>dism /online /disable-feature /featurename:Certificate Services
| Removes the AD CS role. |
Adding the AD LDS Role with dism
The following table shows the syntax to add and remove the AD LDS role.
Commands to Add PowerShell | Comments |
---|
C:\>dism /online /enable-feature /featurename: DirectoryServices-ADAM- ServerCore
| Installs the AD LDS role. |
C:\>dism /online /disable-feature /featurename: DirectoryServices-ADAM- ServerCore
| Removes the AD LDS role. |
Adding PowerShell with dism
The following table shows the syntax to add PowerShell.
Note
PowerShell is not supported in Windows Server 2008 Server Core, but it is supported in Windows Server 2008 R2 Server Core.
Commands to Add PowerShell | Comments |
---|
C:\>dism /online /enable-feature /featurename:MicrosoftWindowsPowerShell
| Installs Windows PowerShell. |
C:\>\windows\system32\ WindowsPowerShell\v1.0\powershell.exe
| Starts PowerShell. |
2. Adding the AD DS Role
You use the dcpromo
tool with an unattend file to install AD DS on a Windows Server 2008 or
Windows Server 2008 R2 Server Core server. The basic syntax is
dcpromo /unattend:unattend-file