>> 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.
>> 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 ====