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.
But it’s much cooler to use PowerShell to check if you have installed the needed server roles
Just open Windows PowerShell, load the ServerManager Module and run the Get-WindowsFeature Cmdlet. That’s all to it.
And if you want to can also add the missing roles using the Add-WindowsFeature Cmdlet.
Have fun learning PowerShell!
Comments
Anonymous
January 01, 2003
Hi Ram, Check technet.microsoft.com/.../ee662311.aspx /StefanAnonymous
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! StefanAnonymous
January 01, 2003
Hi Ram, What kind of server roles do you want to check? Operations Manager Server roles or just Windows Server roles? /StefanAnonymous
February 07, 2011
The comment has been removedAnonymous
January 29, 2013
Installed only: Get-WindowsFeature | where {$_.installed -eq $true} | select displayname, name, installedAnonymous
January 29, 2013
Jose, Thanks for explaining. StefanAnonymous
August 20, 2013
i want to check just check role of server , how cn i do tatAnonymous
August 22, 2013
Hi Stefan, just want Windows Server roles using powershellAnonymous
January 28, 2015
nice information joseAnonymous
July 28, 2015
worked perfectly !Anonymous
December 05, 2017
Awesome, Thank you