Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Tuesday, November 8, 2011

List installed roles and features in Server Core 8

Tested on Windows Server 8 Developer Preview.

On the 2008 R1 and R2 versions of Server Core, we could list all the roles and features using the OCList command.  This gave us a large and messy list.  We can use PowerShell to give us a list of what is installed, and separately what is not.
At the command prompt, type PowerShell and press Enter.

We need to expand the normal cmdlet set for PowerShell by importing the ServerManager module.

Import-Module ServerManager

To get a list of all installed components:

Get-WindowsFeature | Where {$_.Installed –eq $True}
image

Conversely, we can also get this list of roles and features that are not installed.
Get-WindowsFeature | Where {$_.Installed –eq $False}

2 comments:

Kathleen said...

I have a dumb question. When I go into PowerShell and type "Import-Module ServerManager" I get an error message that ServerManager was not loaded because no valid module file was found in any module directory. Where do you get ServerManager from?

Jason Yoder, MCT said...

Kathleen,

Make sure you are using Windows Server Core 8. This does not work on Windows Server 2008 R2 Core.

Jason