Ever wonder how to add a feature or role to Windows Server?
Scratching your head, not sure where to go or what to do?
I’m gonna clear it all up for you
and show you two distinct ways you can do it.
All that and more, coming up now.
Hello everybody and welcome back.
My name is Adam Gordon, an edutainer here at ITProTV,
coming at you with another exciting and fun-filled episode
on what you can do with Windows Server.
We take a look at different tasks, everyday operations,
and in general just things
that often make people scratch their heads,
because they want to know how to do ‘em,
but they’re not sure the best way to get the job done.
We’re going to take a look
at how to actually add either features or roles
to your Windows Server installation
and there’s two distinct ways we can do that.
One is from the command-line interface via PowerShell.
One is from the graphical interface from the Server Manager.
We’ll demonstrate both
and we can do this across Server 2016,
Server 2019, and/or brand new Server 2022.
I’m gonna show you how to do it in Server 2022,
but remember, everything we show you in these episodes
is available to you, works the same way,
it can be done exactly the same
across all three versions of Server.
Join me here, if you will.
Take you look at a Server 2022 virtual machine
that I have set up and running.
We’re gonna go ahead.
We’re gonna begin by taking a look
at how we can add a feature or a role
and do so from PowerShell,
from the command line interface
that allows us to maybe script this activity out.
If we wanna automate it
that’s supposed to happen to be in front of the computer
clicking buttons in an interface.
But I will show you how to do both.
So what we’re gonna do is just quickly remind you
of where we can go to find PowerShell.
We go to our Start menu.
Depending on the version of PowerShell
that you may have installed…
if you’re using the default version built into Server 2016,
Server 2019 or Server 2022…
you’ll find it located right there,
highlighted in the square that I’m pointing to.
Under the Windows Server menu over there on the right.
And you can use that
and that as long as you load it as an administrator…
I’ll show you how to right click
and do that momentarily…
you can use that version of PowerShell,
whether you choose to update it or not is fine.
It will work and the commandlets I’m about to show you
are supported in the older version of PowerShell.
This is a five dot x version,
the current default version that ships with Server.
But, if you want the brand new,
absolutely latest version of PowerShell, PowerShell core,
you can go ahead and run PowerShell
currently version seven dot something.
And you have to install that separately.
So you’d have to install that from the downloads site.
And once you do that you’ll find a shortcut
for it typically right at the top of your Start menu.
You can also go down to the folder, right down here,
where it says Windows PowerShell on your Start menu
and find the different versions of PowerShell installed there.
Whichever version you want to use simply right click
and choose under the More option Run as administrator.
That way you have full administrative rights
available to you inside of the PowerShell session.
I’ve done that already and I’ve chosen to go ahead
and use the PowerShell 7 instance, PowerShell Core.
You can see I’m running it as an administrator up there.
That way we’re using the latest version.
And all I’ve done to modify it,
unlike what you’ll see when you start PowerShell,
simply make the console font size big enough
so you can see it.
I’ve made it into a twenty point five
using Lucida Console as my font,
just so it’s easier for you to see on the screen.
Other than that it will look identical
to what you’re going to see
when you launch PowerShell on your machine.
Right having said that,
there’s two or three different commands,
depending on what we want to do, that are helpful here.
I’m gonna show you each of them in turn.
Just taken the liberty of writing them down,
spelling them out so you can see them nice and clearly.
And I can simply copy and paste them
into PowerShell as we use them.
If you want to find out what the current status
is of the features that are installed,
and whether they are enabled or disabled
before we choose to go poking about
and trying to turn them on and off,
it’s probably a good idea to get a listing of them.
We can do that with the Get-Windows optional feature commandlet.
You’ll see it highlighted right there.
And by specifying
that we want to use the dash online parameter,
we can see all of the ones that are currently in the system.
And what their status is.
Whether they’re enabled
or whether they’re not available, they are disabled.
So, I’m just gonna go ahead and paste that in.
I’m gonna go ahead, hit Enter now.
It does take a moment to interrogate the Windows Server,
get back all the settings
for all the different optional features…
there are many of them…
and then to display all that on screen.
So, be patient.
You can see it takes about 30 seconds to report back
and then we get a list that tells us
the name of the feature, whatever it may be,
and its current state, whether it’s enabled or disabled.
And we seem to have a mix of both as we take a look.
And if we scroll back up, all the way to the top of the list,
and it is a long list as you can see,
we will see that we have a mixture of both.
And we can see that that executed with no trouble.
Now let’s just go down, back to the bottom there.
And let’s just clear our screen,
C L S clears our screen for us.
And now that we’ve kind of established
what Windows optional features are there.
And let’s pretend we’ve picked up
on one that we want to be able to enable,
maybe it’s not turned on right now, it’s set to disable,
then our second command would become important.
The enable Windows optional feature commandlet
allows us to turn on, or enable that feature.
We have to use the FeatureName parameter,
so we want to target a specific feature.
We have to provide the name, in this case DirectPlay;
you would just simply substitute
the name of the feature that you want to enable.
Put that inside quotes so it’s treated as a literal string
so we know it is going to represent that name.
The name was direct space play.
You would have space in there;
the quotes allow us to do that.
And then parameter dash All enable
any and all of the dependent features that may rely on,
or that DirectPlay relies on I should say,
to ensure that it is fully functional as we enable it.
So It’s important to note that.
Alright, so we’re gonna go ahead,
we’re gonna copy this; just Control C to copy.
And we’re gonna go ahead, gonna come over here,
just paste that in
and notice the minute I do that it starts running.
And you’ll see a little yellow dialogue are comes up,
enables probably in about 15 seconds,
it doesn’t take too long,
and we get back some information that says
“Online : True”, “RestartNeeded : False”.
We don’t have to restart
for that to become enabled, good to know.
And we’re set to go.
Now we’ve turned that on,
whether we want that one or not
is obviously an important consideration.
But if we want to do the same thing in reverse,
instead of enable, we want to disable, let’s say,
“You know what,
I didn’t really mean to turn that feature on.
I want to turn it off.”
Well, I can do the same thing, just by simply saying
Disable Windows Optional Feature again,
FeatureName parameter, what feature am I targeting?
I’m gonna go ahead and copy that
and I’m gonna go ahead, paste that in.
Hit Enter.
You’ll see it is now disabling instead of enabling.
Notice the Restart needed, still set to False,
but now we know that that has been turned off.
So now we’re good to go
in terms of how we might do this
from a command line, from PowerShell.
A couple of simple commands, nothing too complicated.
You obviously need to understand
what the name of the feature
is that you might be targeting.
So you would want to think about that
and keep that in mind.
But, other than that,
you can easily enable and disable features
and we could easily, just as easily, enable
or disable roles as well, if we chose to do that.
Let’s take a look at how we would do the same thing,
but do so from the graphical interface,
from what we call Server Manager.
Now Server Manager loads by default
on most Windows servers so it would normally be up
and available looking just like this.
But if you weren’t, for some reason, seeing it,
you had to go to the Start menu.
You could do that, you would come right over here
and in that same area where we see PowerShell
we see the Server Manager.
You can simply click on that tile to load it up
and it takes about thirty seconds to a minute
to come up and check the status of all the services
and kind of be ready to go.
Once we’ve done that we’re gonna come over here and
you’ll see right up at the top, in the right-hand corner,
you can see a list of tools and capabilities
that are available to us, that currently exist.
And to the left of that we have Manage.
And Manage is where we’re gonna go to be able
to add or remove roles and/or features.
We’re gonna click on Manage.
And you’ll notice that when we do that
we do have a Shortcut menu that pops out.
Adding roles and features is very simple,
we just click on the appropriate area.
Or if we want to remove something
that’s already been added, we can do that as well.
We’re gonna go ahead and choose
Add Roles and Features so we launch this wizard here;
just minimize, whoops,
just minimize and center that, there we go.
And the wizard tells us that there’s just some information
we want to be aware of before we begin.
Not important for us
when we’re looking to add features or roles.
But just so that you know that we can verify tasks
that are completed as they run through the wizard,
we may be able to close out of the wizard at a certain point
without waiting for tasks to complete.
That kind of information share with us
on the first screen.
So we’re gonna click next.
We are then going to make a choice here
about the installation type that we want to engage in.
You’ll see here role-based or feature-based install,
meaning configuring a single server,
this server, the local server we’re on
by adding roles, role services and/or features.
We’re gonna wanna do this,
through a remote desktop services installation.
A little bit beyond what we’re talking about here,
but we’re gonna stick to what we’re doing on the local machine
and not worry about setting up role services
to support the use of what’s called VDI,
virtual desktop infrastructure,
and allow remote sessions to be managed through
and/or against this or other machines.
So we’re gonna leave the default in place.
Click Next.
We then have to select which server we want to manage.
The default is the local server, the machine we’re on,
that we’re running the Server Manager from.
But I could actually connect out
to another remote machine somewhere else on my network.
And if I have administrative rights,
I’m able to connect to that machine, it’s in my network,
part of my name space and I have rights to it,
I could use this Server Manager
to remotely do what I’m about to do against other machines
without having to necessarily be in front of them
and connected to them physically,
right, sitting in front of them
as opposed to connecting to them remotely.
So, just wanna point that out.
We’re gonna stick with our local machines.
We’re gonna leave the default there.
We then first see that we have access to the list of Server Roles.
And we would then select
by checking off one or more of them
and following the wizard and the additional steps
to configure whatever our choices may imply.
We would then see features
if we choose not to do any server roles
or do server roles and walk through the configuration.
But you’ll wanna go Server Roles
and then Features and then Confirmation.
So we could choose a role out of here if we chose to.
Perhaps something like,
oh I don’t know, the web server, IIS,
so we can host webpages.
and you’ll see there happen to be some features
that the installation of IIS requires.
And the logic here is that those dependencies are known
and they’re triggered in the tool when we make a choice.
And as a result we’re prompted to go ahead
and add those features directly
without having to go to the Features List
and know which ones we need to select.
Well we like that logic
coz it means a foolproof installation.
And It means everything should come out
with the right amount of information available,
the right features installed,
the right dependencies loaded,
so that our system should be functional
and we’re not having to worry about
fixing a bunch of stuff before we can actually use it.
So we like that capability a lot.
So we’ve selected there,
if that’s the role
or roles we’re good with we’ll click to features.
We may want to add additional features,
separate from the ones we’ve just configured,
specific to IIS,
or we’ve chosen to and configure specific to IIS.
And so as we scroll down,
if we choose to add any additional things here,
whatever they may be,
we can simply go ahead and put those in.
Let’s go ahead and let’s add the TFTP Client;
we can make any choice we want here
as long as it makes sense for us.
And then we have some configuration for the role.
And this will vary and depend…
it’s totally dependent on the particular role
that we’ve selected,
in this case the web server.
So there’s going to be some configuration of role services.
So a little bit of documentation
information about what we’re about to do and see.
We then have to go in and make some choices
or perhaps accept the defaults and leave them in place
for the current default configuration
of what an IIS web server would look like.
We see a bunch of stuff is selected
and we have the opportunity to add some additional stuff
as you can see, depending on what we choose to do.
You can see I’m just adding some things in there.
And then when i’m done, go ahead and click Next.
Then it gives me a list of all the different things
that I’ve chosen to install.
Ask the system to configure.
If I do want the machine to restart automatically,
if required without prompting me,
I could check that box off.
If a restart is required the server does so automatically,
it will not prompt me, it just goes ahead and does that.
Good for remote systems
that we’re not sitting directly in front of,
that we have to manage,
we want to have that restart done
without a human being there to push the button.
So that’s a good feature, something to consider.
But keep in mind,
we lose connection to that server when it restarts,
and we have to have a way to get back into it
once it’s up and running, so just keep that in mind.
We’ll click Yes,
nothing we’re doing‘s going to require a restart.
We’ll click Install.
Now this is just going to go ahead
and start the installation
and I mentioned that Microsoft is good about
telling us when we can stay in the window
and need to be here and when we can leave.
It says, “Hey, you can close this wizard,
it won’t interrupt any running tasks.”
We can go ahead and simply exit out,
go on about our business now.
If you want to see a notification or a status update
we can always open this page up again
and look to see what’s going on.
Or we can simply wait here,
it’ll take just a couple of minutes to finish
and then we’ll be able to see that this is done,
we’ll be able to close out of here.
We’re not going to wait around for it to finish,
coz it could take several minutes.
But you can see it’s really not all that complicated.
The hardest part is making the appropriate choices on the menu,
figuring out what role, services and/or features
we actually want to target for installation
during any given cycle as we go in.
Alright we’re gonna close out of here, let that finish up.
When it’s done we’ll be able to see
that there’ll be a change here.
We’ll see IIS will pop in
so we’ll know that it’s been installed
and we’ll also see under Tools
that we’ll see some information about managing IIS.
Made available there so we can visually tell
that that installation’s finished.
So when you need to install, configure and/or modify,
perhaps even remove existing installations of roles,
role services and/or features in Windows Server
we have several options.
We can use the command-line via Powershell,
we can go in and use the Server Manager,
what I called the gooey interface.
And either, or both, will let you do the exact same thing.
The only difference is do you prefer pushing buttons
or do you prefer typing those things in
and maybe automating them at scale?
Both of them allow you to connect remotely
to other systems you have rights to manage.
And both off them will give you feedback
about whether you were successful or not,
as you saw based on the current status of the installation
before you begin whatever tasks you’re looking to target.
Alright, well we’ve finished another perfectly good episode
about how to optimize
and really get the most out of your Window Server experience.
I’m going to wish you “Happy Servering”,
and I’m going to see you soon!