Windows Server 2012 – Retrieving a list of installed roles and features

Windows Server 2012 Manager cmdlets – you must run them in elevated level. Here are few commands how to retrieve information about roles, role service and features available on remote Windows Server® 2012.

  • Display list of all available roles and features and current state on the remote server = SRV007
Get-WindowsFeature -ComputerName SRV007
  • Display a list of all installed roles, features on the remote server and create output with filter Where-Object that it list only roles and features whose state is equal to INSTALLED
Get-WindowsFeature -ComputerName SRV007 | Where-Object InstallState -eq Installed

Note: Windows PowerShell 3.0 that is used on Windows Server 2012 lets you eliminate the script notation, current object placeholder and the dot property notation. This really makes PowerShell 3.0 code easier to read and understand.

Old way the above command would look like:

Get-WindowsFeature -ComputerName SRV007 | Where-Object {$_.InstallState -eq Installed}

Now you can see the difference in command when using PowerShell 3.0 🙂


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.