Net Command
Net Command
If you want to know what's happening with your network from the command line, one
of your best tools is the net command.
Now the net command and has been around like, well, forever.
Literally the first network command I learned in the mid 1980's was the net
command. The net command even predates windows.
It comes from the old Microsoft land manager, the first version of software that
ran in DOS.
I mean this thing is old. But as old as it is, it has been updated and improved,
and you find it even on the most recent versions of Windows 10.
So let's take a quick tour and see what the net command can do for us now to help
you out here what I've got is I've got a system that is on a workgroup named
workgroup and there's just a few other computers out there so one of the first
things we can do at the net command is run net view.
Net by itself it'll give you some ideas of what you can type with that.
Now I'm not going to go through every one of these examples some of them are a
little obsolescent but we'll definitely do a number of these and let's do that net
view.
And you can see I have a total of four systems that are on my work group.
I've got a computer called Mary a computer called Studio which is the machine right
here.
I've got a machine called Windows 10 desktop VM and I've got a printer so running
net view by itself is a great way to make a quick and dirty look of what computers
can my system see with in my work group itself.
Now from there we can do some interesting things for example one thing it's really
important is to be able to use Net User A lot of times you know.
Who am I right now in terms of the networks so I can run that user and it's going
to sit here and say well I'm on the computer studio and my account is called
Michael M and I am an administrator so just a quick i forgot who I logged in as are
what am I right now.
Now at this time I'm going to type net view but instead of just typing that view
I'm going to type the actual name of the computer out there so let's go and do with
10 desktop V.M..
And now what we can see are the actual shares that are on that particular system.
So right now I have two folders shared on there one called Share me and the other
one called users.
One of the things we can do is we can actually go through the process of mapping
the drive using the Net Use command.
So I'm going to type net use now when you map a drive what you're doing is you're
assigning a drive letter to that particular shared folder.
So in this case I'm going to pick an arbitrary drive letter that I know I'm not
using in this case or use w and then I just type in the name of the server which in
this case is going to be when 10 desktop VM.
And then I type the share name and you can see the share name is called Shimbun.
First of all you'll see it says the command completed successfully so it worked.
The other thing is as you'll notice that I'm just typing in lowercase everything
that you do with Windows they mean at this level is always converted to uppercase
so doesn't really matter about case when you're dealing with Windows.
However the interesting point is this I'm going to get to W and let's tip our.
Hi Don.
You know you are so I can use the net command to simply access a shared resource.
Now we can turn that around just as easily what I want to do now is actually take a
resource on my local machine and share it out to the workgroup.
So if you take a look on the screen here you'll see I've got this folder called Don
T.
And what I'm going to do is I'm going to offer that up for people to access.
So what I'm going to do is just type in the net command but this time I'm going to
type in share.
So the first thing I do is I type in the name that I want to call it out on the
network.
I'm going to call a dog I could call it anything I wanted but we'll call it Don T.
And then I type in the name of the resource which in this case is going to be
just because I know it's on my desktop and then the actual name of the folder you
can see it right there is Danti and I hit enter and can't find the file specified.
So you've got to be careful about dealing with the net command like any command
like command.
If you don't type the command and right it's going to give you errors like this.
So if we take a look where I'm going to take live where did I make a mistake.
Oh I see it.
I typed in user not users so I'm going to type in net share share name is going to
be Don T equals C colon backslash.
Yeah ok.
So that Sherdog to equal C code backslides users like lym desktop Don T which is
that folder right there.
We hit enter.
And Dante has now been successfully shared so anybody else if they want to they can
go to their command line and do a net use.
However this is also going to show up in their network folder just like any other
shared resource he would do the graphical user interface.
Ok now it's a few other kind of unique commands that you might run into with the
net command let me run through those.
The first one is called Net accounts Net accounts is a pretty handy way to get an
idea of what type of settings you have for all of your accounts.
So if we take a look here for example the minimum password age in days is zero so
people can keep the same password as long as they want maximum password age in days
180 minimum password length.
So it gives you an idea for this individual local system how we have set up our
accounts.
The last one is called net start and it starts a little bit dated but I would at
least bring it up to you what you have is a bunch of network based services running
on this system.
Now me normally I'm just going to run services and see if I need to start and stop
services.
However if you need to you can do some stuff from here so I'm going to run net
start and what it's showing you right here are all of the different services that
are network base that are running on this particular system.
So if I want to I can turn something off with Pick something relatively safe.
I am going to turn off the World Wide Web publishing service so to do this I'm
going to run the net stop command and I can turn it off just by typing it in.
And it's going to go ahead and stop my web server and I did have a web server
running on this particular system.
So the net command has been around for a long long time.
However in most cases my big use with the net command more than anything else is
doing that.
NET VIEW you talk about a quick and dirty way to be able to see what's happening on
your network from a grand line.
The net command is a very old command that helps manage a network
The net command has many different options to manage a network (net use, net share,
etc.)