Compartilhar via


Checking Server Roles with PowerShell

Today I’m rebuilding some of my demo servers in my demo environment and before I can install the software, some pre-requisites need to be checked. You need to check if some Windows Server Roles are installed before starting the installation.

Off course you can just use the Server Manager to check the Roles and if necessary install the missing server roles.

imagec

But it’s much cooler to use PowerShell to check if you have installed the needed server roles Winking smile

Just open Windows PowerShell, load the ServerManager Module and run the Get-WindowsFeature Cmdlet. That’s all to it.

image

And if you want to can also add the missing roles using the Add-WindowsFeature Cmdlet.

Have fun learning PowerShell!

Tweet

Comments

  • Anonymous
    January 01, 2003
    Hi Ram, Check technet.microsoft.com/.../ee662311.aspx /Stefan

  • Anonymous
    January 01, 2003
    Hi OJ King, Good question. Get-Help is your friend on this question. First open PowerShell, load the ServerManager Module. Type: get-help windowsfeature and you see that there is also a remove-windowsfeature cmdlet. Now you ask get-help for help on the remove-windowsfeature cmdlet. Type: get-help remove-windowsfeature -examples Now you see some examples and one the examples you can use: Get-WindowsFeature Web-* | Remove-WindowsFeature Have fun! Stefan

  • Anonymous
    January 01, 2003
    Hi Ram, What kind of server roles do you want to check? Operations Manager Server roles or just Windows Server roles? /Stefan

  • Anonymous
    February 07, 2011
    The comment has been removed

  • Anonymous
    January 29, 2013
    Installed only: Get-WindowsFeature | where {$_.installed -eq $true} | select displayname, name, installed

  • Anonymous
    January 29, 2013
    Jose, Thanks for explaining. Stefan

  • Anonymous
    August 20, 2013
    i want to check just check role of server , how cn i do tat

  • Anonymous
    August 22, 2013
    Hi Stefan, just want Windows Server roles using powershell

  • Anonymous
    January 28, 2015
    nice information jose

  • Anonymous
    July 28, 2015
    worked perfectly !

  • Anonymous
    December 05, 2017
    Awesome, Thank you