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 [easyazon-link asin=”B008X73O5A” locale=”us”] Windows Server® 2012 [/easyazon-link].

  • 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 [easyazon-link asin=”0735673101″ locale=”us”] Windows Server 2012 [/easyazon-link] lets you eliminate the script notation, current object placeholder and the dot property notation. This really makes [easyazon-link asin=”0735663394″ locale=”us”] PowerShell 3.0 [/easyazon-link] 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 [easyazon-link asin=”1935182137″ locale=”us”] PowerShell 3.0 [/easyazon-link] 🙂

[easyazon-image align=”none” asin=”0735663394″ locale=”us” height=”160″ src=”” width=”131″]


Leave a Reply