Adding Roles and Features


Now that we’ve looked at the various roles, role services, and features that are available in Windows Server 2008, let’s look at how to install them on a server. There are basically three ways to do this:

  • From the Initial Configuration Tasks (ICT) screen

  • Using Server Manager

  • From the command line

What about installing roles and features during setup? Can you configure an unattend.xml file so that a role such as File Server or Network Policy and Access Services is automatically installed after setup finishes? I asked this question of someone on the product team while writing this chapter. The answer I got was “Yes and no,” meaning that it might be possible but would involve “stitching” a lot of things together to make it happen. To understand why this is so, we need to understand a bit about how roles and features are defined “under the hood” in Windows Server 2008, and this involves understanding something called CBS Updates. And no, this has nothing to do with late-breaking news on television…

Let’s pause again for a moment and listen to an expert at Microsoft explain the architecture behind roles and features in Windows Server 2008:

image from book
From the Experts: Component Based Servicing

Windows Vista and Windows Server 2008 have a new architecture, called Component Based Servicing (CBS), to capture all the dependencies across binaries, system integrity information per resource, and any customized commands that were needed for servicing to occur. The new architecture provides a unified platform for OS installation and optional component installation and servicing. CBS allows Microsoft to build new SKUs in a more agile way, and the Windows server core installation of Windows Server 2008 is a direct result of moving Microsoft Windows to this new architecture.

The flip side of providing this level of componentization is that now there are many more optional components that you can install on Windows Server since fewer components are now installed by default. Another factor that adds complexity is the number of dependencies between these different optional components. Finally, while most of the optional components in Windows Server use the CBS technology, there are a couple of exceptions (such as SharePoint and the Windows Internal Database) that use MSI as their installer technology instead. One can get a glimpse of this complexity by using tools such as pkgmgr.exe and OCSetup.exe to install optional components. The command to perform a complete install of the Web Server role looks like this:

start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IISCommonHttpFeatures;IIS- StaticContent;IIS-DefaultDocument;IISDirectoryBrowsing;IIS-HttpErrors;IIS- HttpRedirect;IISApplicationDevelopment;IIS-ASPNET;IIS- NetFxExtensibility;IIS-ASP;IIS-CGI;IISISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IISHealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;  IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS- WindowsAuthentication;IISDigestAuthentication;IIS- ClientCertificateMappingAuthentication; IIS- IISCertificateMappingAuthentication;IIS- URLAuthorization;IISRequestFiltering;IIS-IPSecurity;IIS-Performance;IIS- HttpCompressionStatic;IISHttpCompressionDynamic;IIS- WebServerManagementTools;IIS-ManagementConsole;IISManagementScriptingTools;IIS- ManagementService;IIS-IS6ManagementCompatibility; IIS-Metabase;IIS- WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;IISFTPPublishingService;IIS- FTPServer;IIS-FTPManagement;WASWindowsActivationService;WAS-ProcessModel;WAS- NetFxEnvironment;WASConfigurationAPI 

Server Manager reduces these complexities by grouping optional components into Roles and Features, which are collections of optional components that together address a particular need. Server Manager also automatically handles dependencies between optional components, so that you don’t need to worry about creating a command that is more than a dozen lines long! The different installer technologies are also handled uniformly by Server Manager. Thus, you don’t need to worry about which command to use to install roles and features based on which installer technology they use.

Finally, which command do you like better? The one above or this one:

servermanagercmd -install Web-Server –allsubfeatures

For more on the Server Manager command-line interface (CLI), see my second sidebar later in this chapter.

-Eduardo Melo

Lead Program Manager, Windows Enterprise Management Division

image from book

Using Initial Configuration Tasks

The most obvious way of adding roles and features is to do so from the Initial Configuration Tasks (ICT) screen that is presented to you the first time you log on to Windows Server 2008. We looked at this tool in the previous chapter; now let’s try using it-first to add a role and then to add a feature.

We’ll begin by adding the File Server role. Here’s the ICT screen again:

image from book

Note that next to “Roles,” it says “None.” This means that we haven’t installed any roles yet on this particular machine. Let’s click the Add Roles link. This starts the Add Roles Wizard (ARW), a simple-to-use tool that walks us through the steps for installing roles on our server. The initial ARW screen looks like this:

image from book

Notice that the initial screen of the wizard reminds us to make sure we’ve completed certain precautionary steps before adding roles to our wizard. Clicking Next displays the different roles we can now choose to install:

image from book

A big improvement of Windows Server 2008 over previous versions of Windows Server is that you can now choose to install multiple roles at once. Remember the Manage Your Server Wizard in Windows Server 2003? If you wanted to configure your server as both a file server and a print server, you had to walk through the wizard twice to do this. With Windows Server 2008, however, you can multiselect the roles you want to install and you need to walk through the wizard only once. Of course, this might not be 100 percent true because certain roles can have dependencies on other roles-I have to confess that I haven’t tried all 262,143 (218–1) possible combinations of roles in this wizard, so I can’t confirm or deny whether this might be an issue or not. Perhaps the technical reviewer for this book can test this matter thoroughly, provided he feels that Microsoft Press is paying him enough for all the effort involved!

Anyway, let’s select the check box for the File Server role and click Next. When we do this, a screen gives us a short description of the role we selected. We’ll skip this screen and click Next again to display a list of role services we can install together with this role:

image from book

Because there are no check boxes preselected on this screen, all the role services available here are optional. So if we wanted to install only the File Server role and nothing else, we could just click Next and finish the wizard. Let’s choose one of these role services, however-namely, the File Server Resource Manager (FSRM) console, a tool for managing file servers that was first introduced in Windows Server 2003 R2.

After we select to install this additional role service to our role, we click Next and get a confirmation screen telling us which role(s) and role service(s) we’re going to install:

image from book

What if we decide we want to add another role service, or maybe even an additional role? The nice thing about this wizard is that you can jump to any screen of the wizard simply by selecting its link from the left.

But we want to install only one role and one additional service. To do this we click Install and wait awhile for the selected components to install. (This takes some time because we’re dealing with a beta version of the platform.) Note that we aren’t prompted for the source files, which is a nice touch-when you install Windows Server 2008, everything you need to install additional components later is already there on your server.

Once the File Server role has been successfully installed, the wizard displays confirmation of this. When you close the wizard and return to the Initial Configuration Tasks screen, the added role is displayed where before it said “None.” (See the first screen shot of this section.) And sure enough, if you select Administrative Tools from the Start menu, you’ll see a shortcut there for launching the File Server Resource Management console.

Adding features is a very similar process, and it uses an Add Feature Wizard (AFW) that you can launch by clicking the Add Features link in the Initial Configuration Tasks screen. The AFW wizard displays a list of optional features you can add to your server:

image from book

I won’t bother walking you through this second wizard, as you’re an IT pro, you’re smart-you get wizards. If you do want to try adding a feature, however, you might start by installing Windows Server Backup. Why that feature in particular? Because backups are important- duh!

There is one more thing you might be wondering, however, if you’ve played around with adding roles using ICT. If you click Add Roles once more in ICT to run the ARW again and display the list of roles, you’ll see that the File Server role is grayed out:

image from book

In other words, you can’t deselect the File Server role to uninstall it should you want to do this. Why can’t you do this? Well, it’s not called the Add Roles Wizard for nothing! Anyway, we’ll see how to remove roles in a moment, but first let’s move on to another tool for managing roles: Server Manager.

Using Server Manager

Adding roles and features using Server Manager is a no-brainer. But before we do this, let’s open Server Manager and view the results of the procedure we just completed, where we added the File Server role and File Server Resource Management console to our server:

image from book

Now to add a new role to your server, simply right-click the Roles node (which is selected in the preceding screen shot) and choose Add Roles to launch the Add Roles Wizard. You can also remove roles easily by right-clicking the Roles node and selecting Remove Roles, which launches the (you guessed it) Remove Roles Wizard.

In a similar way, you can add or remove role services for a particular role by right-clicking a role (such as File Server displayed here) and choosing either Add Role Services or Remove Role Services from the context menu. And you can add or remove features by right-clicking the Features node and choosing the appropriate option. Finally, by right-clicking the root node (Server Manager), you can add or remove both features and roles. I told you it was a no-brainer.

From the Command Line

Something neat that was added in IDS_2, also known as February 2007 Community Technology Preview, is the ability to add or remove roles and features from the command line. This can be done using the ServerManagerCmd.exe command that we talked about in the previous chapter. As we saw, ServerManagerCmd.exe is a powerful tool both for installing and removing roles and also for previewing what components would be installed if you actually decide to add a particular role. I showed you some basic examples of how to use this command in the previous chapter, so here I’m just going to provide you with a few more examples of what this powerful command can do:

  • servermanagercmd –install Web-Server –whatif This command analyzes which specific roles, role services, and features would be installed as part of installing the Web Server role. It compares the list of roles, role services, and features that we know are part of the Web-server role with the list of roles, role services, and features that are already installed on the computer. Only the ones currently not installed are identified as applicable for installation on that particular computer. This functionality really helps you understand the full list of actions that will be performed with the command, without actually making changes to the computer.

  • servermanagercmd –install Web-Server This command is the same as the previous command without the –whatif flag. So this time it actually installs the Web Server role.

  • servermanagercmd –install Terminal-Services –restart This command installs the Terminal Services role. Given that the installation of this role requires a reboot to complete, the –restart flag is used to automatically restart the machine to complete the role installation. If –restart is not used, you need to restart the computer manually to complete the role installation.

  • servermanagercmd –remove Web-Server This command removes the Web Server role (assuming it is already installed on the computer). Note that if roles and features that depend on Web Server are installed on the computer (for example, Windows SharePoint Services), they will also be removed from the computer.

  • servermanagercmd –remove Web-Server –resultPath results.xml This command is the same as the previous command, with the addition of the –resultPath flag. Using this flag, ServerManagerCmd.exe will save the results of the removal operation in an XML file that can then be programmatically parsed.

  • servermanagercmd –inputPath input.xml If you want to install (or remove) multiple roles, role services, and features, a more expedient way to do this is by using the –inputPath option instead of using –install or –remove. This is because these two flags accept only one role, role service, or feature at a time, whereas you can specify as many items as needed in the input.xml file. Here’s an example of an input.xml file (which can be named anything else if you like) that installs a whole bunch of features (also called OCs for Optional Components) in a single step:

    <?xml version="1.0" encoding="utf-8" ?> <ServerManagerConfiguration Action="Install"    xmlns="http://schemas.microsoft.com/sdm/Windows/ServerManager/Configuration    /2007/1" xmlns:xs="http://www.w3.org/2001/XMLSchema">    <Feature                        InstallAllSubFeatures="true"/>    <Feature         InstallAllSubFeatures="true"/>    <Feature              InstallAllSubFeatures="true"/>    <Feature                       InstallAllSubFeatures="true"/>    <Feature        InstallAllSubFeatures="true"/>    <Feature                     InstallAllSubFeatures="true"/>    <Feature                InstallAllSubFeatures="true"/>    <Feature          InstallAllSubFeatures="true"/>    <Feature               InstallAllSubFeatures="true"/>    <Feature              InstallAllSubFeatures="true"/>    <Feature              InstallAllSubFeatures="true"/>    <Feature        InstallAllSubFeatures="true"/>    <Feature        InstallAllSubFeatures="true"/>    <Feature                InstallAllSubFeatures="true"/>    <Feature           InstallAllSubFeatures="true"/>    <Feature           InstallAllSubFeatures="true"/>    <Feature                       InstallAllSubFeatures="true"/>    <Feature />    <Feature />    <Feature />    <Feature                       InstallAllSubFeatures="true"/>    <Feature        InstallAllSubFeatures="true"/>    <Feature                  InstallAllSubFeatures="true"/>    <Feature               InstallAllSubFeatures="true"/>    <Feature                       InstallAllSubFeatures="true"/>    <Feature          InstallAllSubFeatures="true"/>    <Feature                InstallAllSubFeatures="true"/>    <Feature               InstallAllSubFeatures="true"/>    <Feature      InstallAllSubFeatures="true"/>    <Feature                       InstallAllSubFeatures="true"/>    <Feature                       InstallAllSubFeatures="true"/>  </ServerManagerConfiguration>

Finally, here’s one more example that’s a bit unique. Normally, you use ServerManagerCmd.exe to install the bits and files associated with a particular role or feature in Windows Server 2008, while any configuration settings associated with that role or feature can be specified later using role-specific or feature-specific tools. But Windows SharePoint Services (WSS) is an exception to this because there are two settings that must be specified as part of the role installation. These two settings determine whether WSS should be installed as a single server deployment or as part of a server farm, and which language should be used for the SharePoint administration Web site. Here’s how you install the WSS role on your server using ServerManagerCmd.exe and configure these two settings:

servermanagercmd -install Windows-SharePoint –setting InstallAsPartOfServerFarm= false–setting Language=de-de

Finally, a few words from one of our experts on the product team concerning ServerManagerCmd.exe and its usefulness for adding and removing roles from the command line:

image from book
From the Experts: The Server Manager CLI

The Server Manager command-line interface (CLI) is one of my favorite features in Server Manager. The Server Manager GUI (console and wizards) provides a consolidated view of the server, including information about server configuration, status of installed roles, and links for adding and removing roles and features. The CLI makes the key pieces of functionality from the Server Manager GUI also available from the command-line prompt, which allows the user to perform tasks such as installing a role and verifying which roles are currently installed on the machine from the command prompt or via scripts.

Using remoting technologies such as Windows Management Instrumentation (WMI) and Windows Remote Management (WinRM), you can now start taking advantage of the CLI from a remote machine (your Windows Vista desktop, for example) or manage multiple servers at the same time. Additionally, the CLI takes input and produces output in XML format, which makes it much easier to programmatically “control” the CLI.

You might be asking where I am going with this. Well, here is what I want to do: create a lightweight application that I can run on my Windows Vista machine and that allows me to remotely connect (via WMI or WinRM) to my Windows Server 2008 server in my office. After connected to the server, my application would remotely run the CLI with the –query flag and get the list of available roles and features back in an XML file. It would then parse the results from the XML and list back to me the roles and features available on my server, including which roles and features are currently installed on the server. My application GUI would then allow me to select roles and features that I want to install (or remote). After making my selections, the application would again remotely run the CLI (this time using the –install, –remove or most likely the –inputPath flag) so that the roles and features that I specified can be remotely installed (or removed) on my Windows Server 2008 machine.

Now I just need to find some spare time to build this application!

-Eduardo Melo

Lead Program Manager, Windows Enterprise Management Division

image from book




Microsoft Windows Server Team - Introducing Windows Server 2008
Introducing Windows Server 2008
ISBN: 0735624216
EAN: 2147483647
Year: 2007
Pages: 138

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net