Running Windows Core: How-to view, enable and disable roles and features


Running Windows Core Series, roles and features without Server Manager.

 

When running these commands or using them in scripts keep in mind that some may become deprecated in future versions of Windows. Best practice is to use the PowerShell commands when possible to future proof any script that use these commands. These commands were run on Windows Server 2012R2.

When running Windows Server 2012+ without a GUI note that the GUI can be reinstalled via PowerShell (Install-WindowsFeature) and a reboot.

 

 

From Windows Server core command prompt:

 

To view the list of roles and features and their installation status.

 

C:\>POWERSHELL

PS C:\>Get-WindowsFeature

Or

 

C:\>DISM.exe /online /Get-Features

 

To install the File and Storage Services role and all of the role services for it along with the management tools and reboot.

 

C:\>POWERSHELL

PS C:\>Install-WindowsFeature -ComputerName 2012R2Core -Name FileAndStorage-Services -IncludeManagementTools -IncludeAllSubFeatures -Restart

 

To uninstall/remove a Windows role or feature, keeping the source files available for future installations.

 

C:\>POWERSHELL

PS C:\>Remove-WindowsFeature -ComputerName 2012R2Core -Name FileAndStorage-Services -IncludeManagementTools -Restart

To uninstall and completely remove the installation files from Windows.

C:\>POWERSHELL

PS C:\>Remove-WindowsFeature -ComputerName 2012R2Core -Name FileAndStorage-Services -IncludeManagementTools -Restart -Remove

 

You can also add or remove roles and features from a .VHD image file. No need for a restart in that case.

C:\>POWERSHELL

PS C:\>Remove-WindowsFeature -ComputerName 2012R2Core -Name FileAndStorage-Services -IncludeManagementTools -Vhd c:\temp\2012R2Core.vhdx

 

If you know any other interesting ways of getting this information from a Windows Server core installation post below.

Thanks for stopping by and see other Windows Server core tips; http://blogs.technet.com/b/chad/archive/tags/server+core/default.aspx

Comments (0)