Installing roles and features

Installing the operating system itself gets your foot in the door, so to speak, using your server as a server. However, you can't actually do anything useful with your server at this point. On a client desktop system, the base operating system is generally all that is needed in order to start working and consuming data. The server's job is to serve up that data in the first place, and until you tell the server what its purpose is in life, there really isn't anything useful happening in that base operating system. This is where we need to utilize roles and features. Windows Server 2016 contains many different options for roles.

A role is just what the name implies, the installation of a particular role onto a server defines that server's role in the network. In other words, a role gives a server some purpose in life. A feature, on the other hand, is more of a subset of functions that you can install onto a server. Features can complement particular roles, or stand on their own. They are pieces of technology available in Windows Server 2016 that are not installed or turned on by default, because these features wouldn't be used in all circumstances. Everything in the later chapters of this book revolves around the functionality provided by roles and features. They are the bread and butter of a Windows Server, and without their installation your servers make good paperweights, but not much else. Since we will not be taking the time in each chapter to cover the installation of every particular role or feature that will be used within the chapter, let's take some time right now to cover the most common paths that admins can take in order to get these roles and features installed onto your own servers.

Installing a role using the wizard

Without a doubt, the most common place that roles and features get installed is right inside the graphical wizards available as soon as your operating system has been installed. By default, a tool called Server Manager launches automatically every time you log in to Windows Server 2016. We will take a closer look at Server Manager itself coming up shortly in this chapter, but for our purposes here we will simply use it as a launching platform in order to get to our wizard which will guide us through the installation of our first role on this new server we are putting together.

Since you have just logged into this new server, you should be staring at the Server Manager Dashboard. Right in the middle of the Dashboard, you will see some links available to click on, a quick start list of action items numbered one through five. If you haven't already done so, put into place any local server configuration that you may need on this machine through the first link which is called Configure this local server. Items that you likely want in place are things such as a permanent hostname for the server, IP addressing, and if you are joining this server to an existing domain, you typically handle that process prior to implementing any new roles on the server. But in our case, we are more specifically interested in the role installation itself, so we will assume that you have already configured these little bits and pieces in order to have your server identified and routing on your network.

Go ahead and click on step 2, Add roles and features. Another way you can launch the same wizard is by clicking on the Manage menu from the top bar inside Server Manager, and then choosing Add Roles and Features from the drop-down list. Selecting either link will bring you into our wizard for installation of the role itself:

You are first taken to a summary screen about installing roles, go ahead and click on Next to bypass this screen. Now we get into our first option, which is an interesting one. We are first asked if we want to continue on with a Role-based or feature-based installation, which is exactly what we have been talking about doing. But the second option here, Remote Desktop Services installation, is important to note. Most of us consider the Remote Desktop Services (RDS) components of a Windows Server to be just another role that you can choose when setting up your server, similar to installation of any other role. While that is basically true, it is important to note that RDS is so functionally different from the other kinds of roles that the entry path into installation of any of the RDS components invokes its own wizard, by choosing the second option here. So if you ever find yourself looking for the option to install RDS, and you have glazed over this screen because you are so used to clicking Next through it like I am, remember that you need to head back here in order to tell the wizard that you want to deal with an RDS component, and the remainder of the screens will adjust accordingly.

At the moment, I am working on building out a new test lab full of Windows Server 2016 boxes, and I am still in need of a Domain Controller to manage Active Directory in my environment. Prior to installing Active Directory on a server, it is critical that I have a few prerequisites in place, so I have already accomplished those items on my new server. The items that I need to have in place prior to the AD DS role installation are having a static IP address assigned, and making sure that the DNS server setting in my NIC properties points somewhere, even if only to this server's own IP address. I also need to make sure that the hostname of my server is set to its final name, because once you turn it into a Domain Controller it is not supported to change the hostname.

I have already accomplished these items on my server, so I will continue on through my role installation wizard here by leaving the option on for Role-based or feature-based installation, and clicking on Next:

Our Server Selection screen is a very powerful one. If you've been through this process before, you have likely glazed over this screen as well, simply clicking on the Next button in order to progress through it. But essentially, what this screen is doing is asking you where you would like to install this new role or feature. By default, each server will only have itself listed on this screen, and so clicking on Next to continue is more than likely what you will be doing. But there are a couple of neat options here. First of all, if your Server Manager is aware of other servers in your network and has been configured to monitor them, you will have the option here to install a role or feature remotely onto one of the other servers. We will dig a little deeper on this capability coming up shortly. Another feature on this page, which I haven't seen many people utilize, is the ability to specify that you want to install a role or feature onto a virtual hard disk. Many of us work with a majority of virtual servers in this day and age, and you don't even need your virtual server to be running in order to install a role or feature to it! If you have access to the .VHDX file, the hard disk file, from where you are running Server Manager, you can choose this option that will allow you to inject the new role or feature directly into the hard drive. But as is the case with 99% of the times that you will wander through this screen, we are logged directly into the server where we intend to install the role, and so we simply click on Next:

Now we have our list of roles that are available to be installed. Clicking on each role will give you a short description of the purpose of that role if you have any questions, and we will also be talking more about the core infrastructural pieces in our next chapter to give you even more information about what the roles do. All we need to do here in order to install a role onto our new server is check the box, and click on Next. Since this is going to be a Domain Controller, I will choose the Active Directory Domain Services role, and I will multipurpose this server to also be a DNS Server and a DHCP Server. With these roles, there is no need to re-run through this wizard three separate times in order to install all of these roles, I can simply check them all here and let the wizard run the installers together. Whoops, when I clicked on my first checkbox, I got a pop-up message that the Active Directory Domain Services role requires some additional features in order to work properly. This is normal behavior, and you will notice that many of the roles that you install will require some additional components or features to be installed. All you need to do is click on the Add Features button, and it will automatically add in these extra pieces for you during the installation process:

Now that we have all three of our roles checked, it's time to click on Next. And just to make it clear to all of you readers, I was not required to install all of these roles at the same time, they are not all dependent on each other. It is very common to see these roles all installed onto the same server, but I could split them up onto their own servers if I so desired. In a larger environment, you may have AD DS and DNS installed together, but you might choose to put the DHCP role onto its own servers, and that is just fine. I am configuring this server to support a small lab environment, so for me it makes sense to put these core infrastructure services together in the same box:

After clicking on Next, we have now landed on the page where we can install additional features to Windows Server 2016. In some cases, you may have originally intended only to add a particular feature, and in these cases, you would have bypassed the role screen altogether, and gone immediately to the features installation screen. Just like with the role installation screen, go ahead and check off any features that you would like to install, and click on Next again. For our new Domain Controller, we do not currently require any additional features to be specifically added, so I will just finish out the wizard which starts the installation of our new roles.

After the installation process has been completed, you may or may not be prompted to restart the server, depending on which roles or features you installed and whether or not they require a restart. Once you have landed back inside Server Manager, you will notice that you are now being prompted near the top with a yellow exclamation mark.

Clicking here displays messages about further configurations that may be required in order to complete the setup of your new roles and make them live on the server. For example, in order to finish turning my server into a Domain Controller, I need to run through a promotion process to define my domain, or to specify a domain which I want to join. There are also some loose ends, which I also need to wrap up for putting DHCP into action:

Installing a feature using PowerShell

Now that you have seen the graphical wizards for installing roles and features, you could certainly always use them in order to put these components into place on your servers. But Microsoft has put a big effort into creating a Windows Server environment where almost anything within the operating system can be manipulated using PowerShell, and the addition of roles and features is certainly included in those capabilities. Let's take a look at the appropriate commands we can use to manipulate roles and features on our server right from a PowerShell prompt. We will view the available list of roles and features, and we will also issue a command to install a quick feature onto our server.

Open up an elevated PowerShell prompt, and use the following command to view all of the available roles and features that we can install onto our server. It will also show you which ones are currently installed:

Get-WindowsFeature

What I would like to do on this server is install the Telnet Client feature. I use Telnet Client pretty regularly for testing network connections, so it is helpful to have on this machine. Unfortunately, my PowerShell window currently has pages and pages of different roles and features in it, and I'm not sure what the exact name of the Telnet Client feature is in order to install it. So, let's run Get-WindowsFeature again, but this time let's use some additional syntax in the command to pare down the amount of information being displayed. I want to see only the features which begin with the letters "TEL":

Get-WindowsFeature –Name TEL*

There it is! Okay, so now that I know the correct name of the feature, let's run the command to install it:

Add-WindowsFeature Telnet-Client

One last thing to show you here, there is also a way to manipulate the Get-WindowsFeature cmdlet in order to quickly show which roles and features are currently installed on a server. Typing Get-WindowsFeature | Where Installed presents us with a list of the currently installed components. If I run that on my Domain Controller, you can see all the parts and pieces of my roles for AD DS, DNS, and DHCP: