learn how to 
1- List all Roles and Features on windows server core
2- Enable DHCP Role
3- 
Disable DHCP Role



List all Roles and Features

list all roles and features to get the right name for the DHCP role by using 1 of the following commands
1- oclist (the old command )
         oclist 

2- dism (was introduced in windows server 2008 R2)
          dism /online /get-features    or   dism /online /get-features /format:list


          dism /online /get-features /format:table 

Enable DHCP Role

to enable Roles and Features
  1. you need to get the name of role or feature by using the oclist or dism
  2. use 1 of the next 2 commands
  •  ocsetup ( the old command )
                   start /w ocsetup feature or role name
  • dism ( the new command- was introduced in windows server 2008 R ) 
                   dism /online /enable-feature:feature or role name
Note : Roles and Features are case sensitive ( for example : DHCPServerCore ,  DNS-Server-Core-Role )

for example :
            to enable DHCP on server core
1- ocsetup command
              3 commands are needed 
                        start /w ocsetup DHCPServerCore
                        sc config dhcpserver start= auto
                        net start dhcpserver
Note : in the 2nd command start= auto (there is a space between the equal sign and auto)
2- dism command 
          dism /online /enable-feature:DHCPServerCore
 

Disable DHCP Role

to disable roles and features
  1. you need to get the name of role or feature by using the oclist or dism 
  2. use 1 of the next 2 commands
  •  ocsetup ( the old command )
                    stop /w ocsetup DHCPServerCore
  •  dism ( the new command ) 
                    dism /online /disable-feature:DHCPServerCore

for example :
            to disble DHCP on server core
  1. ocsetup command
  2. dism command 
          dism /online /disable-feature:DHCPServerCore



Find DHCP Role complete name (the name that you will use in your command)

          dism /online /get-features | find "part of the feature or the role name"
   for example :       
            dism /online /get-features | find"DHCP"