Follow this blog:
RSS
Email Alert

TR Dojo

Video: Use PowerShell to list all roles on a Windows Server

Takeaway: Bill Detwiler shows you a pair of PowerShell scripts that can give you a detailed list of all the roles on a Windows Server.

The Server Manager snap-in is a handy way to see what roles a Windows server has and to add new ones. But, it doesn’t give you a lot of detail about those roles. During this week’s episode of TR Dojo, I show you how to quickly get detailed information about all the roles on a Windows server using two PowerShell scripts (import-module servermanager and get-windowsfeature).

February 3, 2011, 12:00 AM PST | Length:00:04:14

View Transcript

For those who prefer text to video, you can click the Transcript link that appears below the video player window or check out Rick Vanover’s original article.

You can also sign up to receive the latest TR Dojo lessons through one or more of the following methods:

Would you buy an outdated, but extremely cheap tablet?

Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free newsletters.

Bill Detwiler

About Bill Detwiler

Bill Detwiler is Head Technology Editor of TechRepublic. Previously, he worked as a Support Tech and IT Manager in the social research and energy industries.

Bill Detwiler

Bill Detwiler
Bill Detwiler is Head Technology Editor for TechRepublic. Previously he worked as a Technical Support Associate and Information Technology Manager in the social research and energy industries. Bill is a Microsoft Certified Professional with experience in Windows administration, data management, desktop support, and system security.

Bill Detwiler

Bill Detwiler
Bill Detwiler has nothing to disclose. He doesn't hold investments in the technology companies he covers.

Transcript

Background Noise

>> Bill Detwiler: The Server Manager snap-in is a handy way to see what roles a window server has and to add new ones, but it doesn't really give you a lot of detail about those roles, or if it does it's hard to get to that information. Well, I'm Bill Detwiler and during this episode of TR Dojo I'll show you a pair of PowerShell scripts that give you a lot more detail than you probably ever expected about the roles on a window server.

Music

>> Background music This episode of TR Dojo is brought to you by Tech Republic's Guide to Policies and Procedures. This time saving guide contains over a hundred customizable templates and forms. Go to policies.techrepublic.com to get your copy today.

>> Both the base release of Windows Server 2008 and Server 2008 R2 use the Server Manager snap-in to add roles and see what roles are currently in use. Now this can be for roles such as ISS, which may be required for an application and has a web base component. Or for more core infrastructure services such as active directory domain services, the infrastructure is going to function as a domain controller. Now the Server Manager snap-in is a fairly intuitive way to see what roles are in use and not, but the issue is that the tool doesn't readily show details about those roles or it's just hard to get to that information. For example, let's say the basic FTP traffic is prohibited on a network, yet ISS, or web traffic, is allowed. Without some digging around it's tough to determine this from the server manager console. Luckily, you can quickly get a detailed picture of all the services running on a server with a pair of PowerShell scripts. First is Import-Module Server Manager and second is Get Windows Feature, which reports the server's current state. Now when you execute these scripts one right after the other you'll get a list of all the roles and features on the server, including dot net services and remote desktop services if the server functions as a terminal server. Now in this example I've highlighted several of the active roles on this test system. Because these scripts generate a rather long output stream you may want to export the data to a test spot just to make it a little easier to read. Having this data is also a handy way to benchmark your server's roles and features and then check them on a regular basis just to make sure that your machines are running what they should be. And to generate the export report Tech Republic blogger Rick Vanover suggests creating a PowerShell script file, which is basically a text file, with the PS1 extension. Now inside the file you're going to put the text shown here. Import-module Server Manager and then pipe Get-Windows Feature followed by the location where you want the output file to go. Now note that in this example the file is going to be run in the location with the default of PowerShell on the Windows server. Now you can change this to fit your environment. Well, that does it for this episode. For more Windows server tips and tricks check out Tech Republic's Servers and Storage blog or subscribe to our Servers and Storage newsletter. I'll link to both in the TR Dojo blog. And as always, for more teachings on your path to becoming an IT ninja visit Trdojo.techrepublic.com. Or you can follow me on Twitter at Twitter.com/billdetwiler. Thanks for visiting another TR Dojo. Windows Server 2008 R2, as well as the base release, use Windows -- ah, this doesn't make -- users. It's plural. It should be use. Okay. And Get Windows feature which reports the current state. That doesn't make any sense. I just need to say it differently. Laughing. Okay, Bill. Background noise.

==== Transcribed by Automatic Sync Technologies ====