Adding and Removing server roles and optional features on Server Core

It has been a little over a week and my plan is to try and post about once a week, so here goes post #2.


I’ve been told that Longhorn Server beta 2, including Server Core, are going to be available to MSDN and TechNet subscribers, so anyone with access to either of those can play around with Server Core.


There is a Server Core forum in the TechNet forums at:, which can also be used for questions.


Once you have Server Core installed, it isn’t going to do much for you unless you want to practice your old MS-DOS command line skills J To really make Server Core useful, you need to install a server role and/or optional feature so that it does something on your network. Here is how to do that….


To install a server role on Server Core, you need to use the following command line:

Start /w ocsetup RolePackage

Where RolePackage is one of the following:

  • DHCP = DHCPServerCore

  • DNS = DNS-Server-Core-Role

  • File = File-Server-Core-Role

  • File Replication service = FRS-Infrastructure

  • Distributed File System service = DFSN-Server

  • Distributed File System Replication = DFSR-Infrastructure-ServerEdition

  • Network File System = ServerForNFS-Base

  • Single Instance Store = SIS


You may be wondering why Active Directory isn’t in the list above and that is because it is a bit different from the other roles. To install Active Directory, you need to use the following command line:

Dcpromo /unattend:Unattendfile

In Longhorn Server, the dcpromo tool that is installed by default performs the installation and removal of the rest of the Active Directory binaries. The unattend file is the same file and format that you can use when running dcpromo unattend on Server.


To install an optional feature on Server Core, you need to use the following command line:

Start /w ocsetup OptionalFeaturePackage

Where OptionalFeaturePackage is one of the following:

  • Failover Cluster = FailoverCluster-Core

  • Network Load Balancing = NetworkLoadBalancingHeadlessServer

  • Subsystem for UNIX-bases applications = SUA

  • Multipath IO = Microsoft-Windows-MultipathIO

  • Removable Storage Management = Microsoft-Windows-RemovableStorageManagementCore

  • Bitlocker Drive Encryption = BitLocker

  • Backup = WindowsServerBackup

  • Simple Network Management Protocol (SNMP) = SNMP-SC

 To remove a server role or optional feature, you use the same command line but add /uninstall.


Ocsetup is currently case sensitive, so you need to use the names exactly as above.


Until next week,



Comments (4)

  1. Anonymous says:

    こんにちは。(やはり、ブログに書いておくことにしました . . .) ご存じの通り Server Core は、Windows Server 2008 R2 で .NET 開発者にとっても無関係なものではなくなりました。いままでは

  2. PatrickE says:

    Thanks Andrew — we’ll link back to this over at our blog as well.

    Patrick Elliott [MS]

    Windows Beta Team

  3. davidadner says:

    I think "ocsetup" would be better served with a tool similar to ntdsutil.exe where you could easily list all available roles, the currently installed roles, install new roles, uninstall roles, etc.  If nothing else "ocsetup" would make more sense if named "roles.exe" or "rolescfg.exe" or something like that.

  4. We are looking into a tool that will list available roles and optional features as well as list what is already installed. Ocsetup is also available in Vista and Server and can be used to perform scripted install/removal in those.

Skip to main content