Ever wonder how to create a user on a server?
Wonder if you could do it across different versions the same way?
Wonder what tools you can use?
Well, guess what?
I'm going to tell you the answers to all those questions
and show you the secrets to make it easy for you;
all that and more, coming up now.
Hello, everybody.
My name is Adam Gordon, an edutainer here at ITProTV,
coming at you with an episode
about how to add a user to your Windows server.
But guess what?
We're going to do this a variety of ways,
use a bunch of cool tools,
and I'm going to let you in on a secret
Microsoft doesn't often tell people;
it's all the same.
What do I mean by that?
You're running Server 16;
you may be running Server 19;
I'm guessing you're not running Server 22 yet,
although you probably want to be.
Latest and greatest
across all three of those versions of server,
we're going to add a user using the same tools,
it's going to look and feel the same,
and by the way, it's going to be super easy.
I'm going to show you how to do it on Server 2019,
but it's going to be the same if you did it on Server 16
and/or if you use the technical preview
and/or the latest version of Server 2022
as it goes to market and ultimately is available.
Join me here.
We're going to run Server 2019 as a virtual machine.
You could see at the lower right-hand corner right here;
I am running Server 2019 Data Center Evaluation Edition.
So we're running the latest current production build of that system,
and I'm going to use the same set of tools I would use
if I do this on Server 16 and or on Server 2022.
Now we're going to do these three different ways for you,
three different versions of the operating system.
We're going to give you three tools and three options to do this.
I'm going to show you
how to do it from the server manager
via a tool called the Computer Management tool.
This is a standalone server; it's not joined to a domain,
so we're going to administer it locally
using our first option, and we're going to use
the computer management console
to be able to use our local users and groups tool.
And we're going to simply add
a user right from the graphical interface.
Once we've done that, we'll take a look at PowerShell.
We'll show you how to do the same thing from the command line.
We'll add a couple of twists to give you a few options there,
but essentially, we'll do the same thing.
And then I'm going to use what I'll say is a new tool,
new in the sense that it's been around
less than the server manager,
less time than some of the versions of server
we're operating on, but it is the future.
It's the Windows Administration Center
web-enabled tool that lets you administer
remote servers as long as you connect them in
and add them to the console.
And we'll use the Windows Admin Center
to show you how to reach out
and do the same exact thing
on one or more connected servers.
So we'll show you three different ways to add a user.
Let's begin by jumping in.
We'll load up and open up our server manager
on the local server, and then we'll use it to access
the computer management tool from the tools menu.
Now, if you're like me when you administer servers,
what I often do is I bring server manager up
when I need it and do whatever I need,
and then I will close it when I'm done.
Number one, because I'm not sure
when I'll come back to the server.
If I do come back remotely versus locally,
I may or may not need that tool.
And if someone else is going to jump on
and administer that server
in-between the times I am there;
I want to leave a tidy workspace for them.
So if you come to the server
and the server manager is closed,
and you've often scratched your head and wonder,
“Well, where to go and how do I get it back?”
Because it loads up automatically
when you log on the first time.
Well, all you have to do is come down here
to the start menu
and let's just zoom in so you could see this.
And when I do that and click,
I'm going to be able to search for it.
It's actually right there in the list alphabetically under "S.”
But depending on the number of programs you have installed,
it may or may not show up and easily be seen right there.
But it's going to be pinned as a tile
under the Windows Server area on the right.
It's in the upper left-hand corner
on that tic-tac-toe board of tiles,
we'll see our server manager,
and I can click there to be able to open it up,
and that's what I'm going to do.
So let me just minimize,
get out of the zoom mode, bring that up.
And although we're not going to load it up right now,
we'll bring it up towards the end of the demonstration.
But if you do want to go ahead and load up
the Windows Admin Center,
you could certainly Google and go out
and find that download league
from the Windows Download Center
to get the Windows Admin Center.
But if you're interested,
Microsoft gives you a nice little prompt here,
and you can just follow that to be able to find out about it.
So I'm just going to get rid of that,
but we know we can download from there.
We're on this machine;
we're in the server manager on the landing page
for the dashboard.
We're going to go over to the right-hand side,
we're going to bring up our tools menu,
and I'm going to go down,
and I'm going to choose computer management.
Second tool, it's alphabetical.
And when I bring up the computer management tool,
it's going to minimize the server manager
while we're at it.
We're going to be able to come over here,
and we're going to be able to see
the fourth item down as we go down;
our local users and groups area will open it up.
We'll see two folders.
We're going to be interested in the Users folder,
and we'll be able to use this, highlighting it
to see what users are currently available on the system
to create and add one or more brand new users.
Now, you may have some default users built-in.
I do, and you will probably have a list
that looks very similar;
you may have additional accounts
depending on the server,
but you'll typically have an Administrator,
Default Account, and Guest Account
or the Default Account, Guest Account,
and whatever additional service accounts
like the WDag Utility Account are going to be disabled.
They have a little arrow on the right-hand side, pointing down in a circle that indicates
they're currently disabled, but you will see they are there.
No additional accounts have been created.
No problem.
We can add one very easily, right-click on the Users folder.
And when we do that, you'll see we get a new user option.
Now I could do that right from here,
or I can move over to the white space anywhere
underneath the existing users right here,
right-click at the same menu option.
And when I do that,
I get a little form that I have to fill out.
That's for some very simple stuff.
Username, full name, description,
password, confirm the password keeping in mind
whatever password policy requirements
in terms of length and complexity we may have,
and then some options about
how we want the user account to initially be configured.
So I'm going to go ahead and add this user in.
I'm going to call this user the Adam2 user.
I'll just go ahead and do that.
We'll put a description in.
Let's call this or say this will be Hello World.
And then I'm going to put in a password
meeting whatever complexity requirements
I may have specified.
So let me just type that in real quick.
I'm going to uncheck the box about
forcing the user to change their password
at the next log on.
We're not going to worry about that.
Assuming I type the passwords correctly
and the matching user is created.
Now, you'll notice the user doesn't show up back here yet,
even though the user has been created.
As soon as I click close, the user account pops right in.
It's there; we just don't see it till the tool closes.
And then I can see, sure enough,
my user account has been created, and we are good.
So let's put a check in that first of three methods
to do this via the gooey,
the Graphical User Interface
using the Computer Management tool, and we are successful.
We're going to minimize that tool, leave it open,
so we're going to use it to verify
how we create our user using PowerShell.
But let's go over here.
I've loaded up PowerShell,
and I've got a few versions of PowerShell on this machine.
I've got the most recent version, PowerShell 7,
what we commonly call PowerShell Core.
I've got the older version of PowerShell that's built-in.
This is PowerShell 5 that's in the system natively,
the command line version.
And then I've got PowerShell ISE,
the graphical editor for PowerShell,
which I'm going to use running as Administrator
just because I have staged the script code
that I want to use with you and show it to you
so I can just have it nice and big on the screen,
don't have to worry about typing it.
And so we're going to look at it there,
and we just simply execute it right from there.
It's all the same
regardless of the version of PowerShell I use,
the command that are supported,
and they will work the same way.
Now, having said that,
if you want to run PowerShell as an Administrator
on any of these versions,
right-click, and under the "more" option,
you will see there is a fly-up menu
that lets you run as Administrator.
I've done that for PowerShell ISE,
I already have it open,
and sure enough, I could see up here at the upper-left
running as Administrator,
giving me the administrative control I need
to execute a command.
Let's make sure I have the permissions necessary
to do these tasks.
Now we're going to start in item number one.
You see, I've commented out
each of the script lines we're going to run.
Create a user, but without a password.
This may or may not be important to you
on a local server, but it's good to know
you can create a user without a password if necessary.
It's a matter of using the right command
and, of course, the right parameters.
In line number three, New-LocalUser is the command;
Name parameter specifies the name of the user.
We'll iterate through in sequence, so we'll do Adam3.
Description parameter, whatever's inside the quotes,
including spaces and punctuation, will be reproduced,
so I can either keep what's there or modify that.
But then the NoPassword parameter
at the end of the line is going to force the creation
of the user without a password.
Let's take a look.
I'll just highlight this.
Now, on ISE, I can just go ahead and highlight the line;
if I only want to execute one line, I could hit F8,
and or I can press that button right up there,
which is going to let me execute the code.
So I'm going to do that.
And when we do that, watch down here,
and we will see that, sure enough, the user is created.
You can see right down here, Adam3, Name Enabled,
status is true, meaning yes,
the user was created, enabled,
and was or is, I should say, available,
and whatever the description is.
Now, I could check the status of the user
right from here by using a get-local,
and we like PowerShell ISE
because it has the auto-sense
and auto-tab complete function,
so actually get the graphical prompt
for whatever commands that I want to potentially use.
I'm going to use GetLocalUser
that's going to allow me to be able to see
a list of all the users on the machine.
And sure enough, there is Adam3 right there,
if I can highlight, and that is the user we just created.
Now, if I go back to the Computer Management tool,
and I just click away
and come back to be able to refresh the screen,
and you have to refresh, it's just the way the tool is,
you'll notice that the Adam3 user was indeed created.
And if we take a look, we can see that, indeed,
“user must change passwords at next logon" is set
because we created the user without a password.
So we have been able to do that in PowerShell,
and before we put a check in our second method,
I have a couple of other things
that may be of interest to you.
So we'll quickly point them out,
but let's call this one basically done as well.
Now, I added some additional code here
that may be of interest to you.
What if you want to create a user with a password?
Well, we could do this a couple of ways.
I could type the password in as I create the user,
but that's not really secure.
It's not going to store the password
in a way that somebody's looking over my shoulder cannot see it,
and if anybody gets a hold of it
or gets a hold of the script
if I save it and make it available,
well, then they know the password for the user,
and that's not really a good idea.
But I can store the password in a variable,
store it securely as a secure string,
so it's not available to anybody.
Even if they bring up the variable,
the $Password statement,
it creates a variable called Password
and sets it equal in line seven
to whatever the output of the prompt
I'm about to create on the screen
with the Read-Host command, will be,
I'll type in a password,
it will be stored but as a secure string.
And then I'm going to, in line nine,
do the same thing I just did,
NewLocalUser, username,
but now I'm going to specify the Password parameter
instead of NoPassword,
and I'm going to use the value of the variable
$Password stored as a secure string
to pass the password through
and create it for the user, but never expose it,
so it's never going to be seen.
And then, I used the FullName parameter
and the Description just that I can round out
the user account creation, as you see.
So let's create this password.
Let me do this.
Now, this is going to prompt me on the screen.
There'll be a dialog box that shows up,
a small rectangular box right in the middle,
and then I don't have to type the password in,
so watch for that.
I'm going to hit F.8.
We see right there.
Let's just zoom in so you can see
that I'm going to type the password in there, hit OK;
it's going to get stored as a secure string.
So I'm going to go ahead, and I'm going to do this.
And notice, you cannot see the password.
You don't know what it is.
I'm typing it; it's just got dots there, so you can't tell.
And if I'm not sure, just try again before I hit OK, all right.
So I'm going to go ahead and do that.
I'm going to set that password, I'm going to click OK,
and it is now stored as a secure string.
So now, just scroll down so we can see that.
If I was to do this,
you'll see I can't see what the password is,
I just get the information
that is associated with the variable,
but that indicator tells me
the password is stored securely,
and I'm not going to be able to see what it is,
but the system can use it
as we're about to see in line number nine.
All right, so now,
I'm going to create a user called Adam4.
We're just going to iterate through there,
going to highlight that, I'm going to hit that.
Sure enough, what do we get?
Adam4 is created, Enabled, True.
If we do this, we can see that Adam4 right there was created.
And if we do this, and we go here, and we do that,
and we come back, whoops, let's refresh one more time.
And sure enough, we could see Adam4 was indeed created.
So we now have created a user
with and without a password using PowerShell.
If I want to add a user to a group,
a little extra bonus for you, you could do that
with the Add-LocalGroupMember commandlet.
You can tell they're based on the Group parameter
and the name I would add,
the Adam4 user into the Administrators group.
And if I want to remove a user,
just simply use the Remove-LocalUser commandlet,
and I can easily remove the user from the system as well.
All right, I'm going to call PowerShell done,
and we've done our second of three ways
or demonstrated our second of three ways
that we can add a user to a local server.
Now, the third way is going to be
using the Windows Administration Center
or Windows Admin Center.
It's a web-based tool I've already installed and configured.
I'm going to bring it up in Microsoft Edge,
and I have a shortcut.
I have just bookmarked rather the shortcut for it there
because I don't want to remember the URL,
so I'm just going to click to bring it up.
You'll see it's going to load up; give it just a second.
Windows Admin Center.
Now, this is used to administer remotely,
meaning I can connect to servers that are anywhere
provided I can get to them through Firewalls,
and I'll make sure that they're available
to the public IP address,
all the stuff we would have to do,
and I can add them in,
and I've got permission, of course, to do that.
Now, I'm cheating a little bit.
I've installed the Windows Admin Center
on the same server I'm about to administer
just for ease of demonstration purposes.
But I can easily be running this from anywhere
as long as I add the server.
And I could do that using the Add feature right here.
Very simple to do, but I've already added it.
So I'm going to just simply click on the link
that represents it;
that is the Gateway that connects me to the server.
And when I do that, it will connect,
and I've got my administrative interface.
We'll give it just a minute to touch the machine,
connect to it, make sure it is communicating.
I could see the general information about it;
I could see all the stuff;
I'm using Windows Server 2019 Data Center Edition,
I could see the size of the system,
the hard drive, the memory, et cetera.
It knows that I am running it as a virtual machine;
it's very smart.
And I can restart, shut down,
do all sorts of stuff from here, which is good to know,
but we're not going to spend time on right now.
And I've got a bunch of different tools available
to me to administer.
Now, we want to add a user, so let's scroll down.
And sure enough,
I actually have two options to do that, by the way.
From here, I can use PowerShell right from here.
Connect to the system remotely as an administrator
and do what I just did in PowerShell,
right from within the Windows Admin Center.
It's actually pretty cool.
I also can come down here and…
whoops, I went too far.
We go back up there.
And I can use the Local User and Group item,
which is the equivalent of the Computer Management tool.
And then just highlighting and finding that tool.
I could do it right from here,
and it's going to look and feel the same.
The only difference is I'm doing it directly on
or from this remote interface.
And we've already been through this;
you know what to do here.
We go, we click New User.
We're going to simply fill in the form.
You could see over here name, full name, description,
password, confirmed password, and then submit.
All right, it looks like we're up to Adam4.
So let's do Adam5.
We'll do that, and we'll do Adam5.
We'll type that in correctly;
we would do description and then our password.
So let's put in our password.
It gives me the information about
whether the password is meeting
those complexity requirements or not;
it's what that red text was.
I want to see the password
to make sure I typed it correctly.
Click there to see it.
I'm going to confirm it.
I'll do that.
Looks like the passwords will match; we click submit.
Sure enough, don't want to save that password.
Password is good.
User has been added successfully.
We can see that, and we can see the user indeed,
whoops, indeed has been added successfully.
There we go right there.
And we can see that if I click through Highlight,
I can manage the user, put it in a different group
like we would have done from PowerShell.
I could delete it
like we would have done from PowerShell,
and you'll notice I can change their password
or edit the user properties right from here
like I could have done from PowerShell
or would do on the local machine directly
from the Computer Management tool.
So these are the three different ways we can go ahead
and add a user into a standalone server,
whether it's running server 2016, 2019, or 2022.
All three mechanisms will work,
all three tools are installable, configurable,
and usable or are already present in the system,
in other words, and all three operating systems
will have the same exact experience for you
as an administrator and as an end-user.
I am going to be back with additional ways
you can streamline, speed up,
optimize your administration of Windows Server,
regardless of the operating system you're running.
But until I come back with more episodes,
I'm going to wish you happy server administering
and remind you;
you can always check us out over at ITProTV
for lots of additional training, tips,and techniques
not only on Windows Server administration
but across all of the different platforms you use.
Whether it's Cisco, whether it's VMware,
whether it's Microsoft Azure, Google Cloud,
and or anything else on-premises or anywhere,
we've got training for it.
We're going to tell you how to do it.
You can always hang out with us to find out more.
I'll see you soon.