What’s Under your Hood? Finding Installed Roles and Role Services
December 20, 2011 3 Comments
Right now i am dealing with an SBS 2008 Server that was missing the Terminal Services Gateway service. This meant that RWA was not working. Users could login to the RWA, choose which computer to connect to, but then they got an error saying that the Terminal Services Gateway service was not running and to call and shout at their Administrator. Well that isn’t exactly what the error said, but you get the idea.
Of course i was surprised to hear this, but being a new client, and one who has not previously tried to use RWA until i suggested it.. it wasn’t being missed obviously. Of course the Eagle eyed among you will now have grounds to comment on my poor documentation skills and the fact i missed something so obvious from our initial site report, well now isn’t the time for that kind of talk.
Anyway moving to a reference SBS 2008 i have setup and running, AKA my production SBS 2008 server, i wanted to try and find out which roles and services were installed relating to the Terminal Services Gateway.
Switching to my PowerShell Admin Guide i found a very useful command, Get-WindowsFeature, unfortunately this book is for PowerShell 2.0 and that command does not seem to want to play on SBS 2008.
So i hit Google and found reference upon reference to Get-WindowsFeature and Server 2008 R2. yes i thought, great, well what do i do about SBS 2008? I noticed that one of the articles mentioned ServerManagerCMD being depreciated. That was a good sign because it means it was most likely depreciated in 2008 R2, but would happily exist in 2008.
As luck would have it, it does.
From PowerShell (running as Administrator) enter: ServerManagerCMD.exe –Query
In the output, anything highlighted in a rather fetching green, is currently installed.
Using this command very quickly allowed me to find exactly which roles were missing, and even which sub components of that role should be selected to be installed.
As you can see from the screenshot, Terminal Services has several Role components, or Role Services as they are known, but for SBS 2008, only the TS Gateway role service is required.
For good measure ill throw in a screen shot of SBS 2011, loading up PowerShell Modules from the Administrative Tools menu, you can run the command everyone is talking about… Get-WindowsFeature
Disappointingly all of the output here is a single colour, which might make it difficult for you to pick out the info you want.
However, being PowerShell we can do a few extra things here such as exporting the output to a text file, or even filtering the output on screen.
If we just want to focus our attention on Terminal Services, we can amend our command like this.
Get-WindowsFeature –name RDS* (remembering that TS is now RDS)
The switch for –name will filter for any role that has RDS in the name, not the display name (see name column below)
Although i am now wondering if this was a bad example because in SBS2011 the RDS roles are installed, but hidden using some lovely SBS Magic.
In any case, this command can be used to identify the roles that are installed on your server, mostly.
For more information about ServerManagerCMD and Get-WindowsFeature check out these resources.