Welcome back to your free training course for Windows 7. In this video I will look at
how to perform remote administration on your Windows 7 computers. There are of course lots
of graphical admin tools that come with Windows that you can use but in some cases these tools
may not do exactly what you want or you many need to repeat the same steps over and over
again on many different computers. To speed up the process Microsoft allow you
access Windows 7 using a remote shell. A remote shell is the same as running a command prompt
remotely on anther computer. Even though the command prompt has been improved
since the MS Dos days, it still is compatible with the MS Dos prompt and thus suffers from
the design limitation of MS Dos. MS Dos has been around since the 1980’s so you
can imagine computers have changed a lot in that time.
To make a more modern command prompt Microsoft has created Windows Power Shell. Windows power
shell replaces the command prompt with a more modern command prompt that can access API’s
like dot net and addresses the limitations of batch files created for the command prompt.
These commands are called CommandLets. If you come for a programming background you
will soon start to see some parallels when using power shell.
In order to allow remote configuration on a Windows 7 computer you need to configure
the Windows remote management service. This can be done by running the command winRM
QuickConfig. This command makes changes to the Windows firewall and also changes the
service start to delayed start. Delayed start means that when the computer
starts up, the start of the service will be delayed giving time for other services and
applications on the computer to start. In order to use remote administration there needs
to be a secure channel between the two computers called a trust relationship.
If both computers are in a domain the trust relationship will already be there for you
so you simply have to run WINRM with Quick Config as the parameter. If the computers
are in a workgroup you will need to run the following command on your admin computer.
Bear in mind that https will be used in this scenario rather than http which means that
you will also need to have certificates installed on the network.
To demonstrate the remote shell and Windows power shell I will now change to my Windows
7 computer. This will be the computer that I will run
the commands on from a remote computer. First it needs to be configured to allow remote
connections. To do this, open a command prompt from the start menu with administrator rights.
From the command prompt run the command WinRM QuickConfig.
The first item I will be prompted for is to allow changes to the w i m r m service to
delayed start. Once I press y I will then be asked to makes changes to the Windows firewall
to allow http traffic through. Once I press y again this computer is now configured to
accept remote commands from anther computer. I will now switch to my admin computer which
I will use to issue commands to the other computer. Notice I have changed the background
to blue to make them easier to tell apart. To start issuing commands I will launch a
command prompt from the start menu. From the command prompt I will run the command
WinRS. This is the command that will run the remote command on the other computer. After
this I need to put in dash colon followed by URL of the computer I am trying to run
the command on. The URL also needs to have a colon on the end followed by the port which
is 5985. Next I need to add dash u colon followed by
the user account which is administrator. Finally I can add the command that I want to run on
the remote computer which in this case is dir of the root of the c drive.
Once I enter in the password, a directory will be shown on the remote system. Any command
that can be run locally on the command prompt can be run like this on the remote computer.
I could for example run system information which will give me some information about
the computer. Running commands like this may meet your needs,
however if you want more power and a better system for accessing the internal API inside
Windows you should consider running power shell.
To run remote commands on anther system you require power shell version 2. This comes
with Windows 7 by default. If you are running Windows Vista you will need to install it.
To launch a command on a remote system you need to run the ICM command let otherwise
known as the invoke command. The syntax is quite simple. Run ICM followed
by the computer name and the commands you want to run in curly brackets. For example,
if I want to find out all the services running on a remote system I could run the command
let get services. I will now switch to my Windows 7 admin computer and launch some commands
on my Windows 7 computer remotely. First I will launch PowerShell from the start
menu. The first noticeable difference between power shell and the command prompt is that
the screen is blue rather than black. Notice the PS at the start of each line. First of
all I will run the command get dash WMI object. WMI or Windows Management Instrumentation
provides access to a lot of information about your system. In this case I will enter in
dash class to select a class. In this case I will select win32desktop. This contains
a lot of information about the desktop like wallpaper settings, screen resolution etc.
The list is quite long because it contains details for each desktop on the computer,
this not only incudes the logged in user but also any other users on the computer.
Since I configured my other computer to accept command from remote using the WINRN QuickConfig
command, I can also run commands on it using power shell. To run the previous commands on
ws1, I will run “ICM” at the start of the line followed by ws1. ICM runs the invoke
command let which will run the command on the remote computer.
The command I want to run needs to be incased in curly brackets since it is now a parameter
of anther command. You can start to see the power of power shell. I could write a script
to connect to all the computers on my network and perform a check of which wall paper they
had and thus making sure they are meeting the company standard.
The information shown is quite a lot so I will reduce it to the bits that are relevant.
A lot of commands have additional parameters and in this case I can add the property value
and enter in wallpaper. This has greatly reduced the amount of information but there is still
too much. To reduce it even further I will add filter
findSTR slash b wallpaper to the end of the command. The filter command or pipe command
passes the output from one command to another. The findstr command looks for a string
on each line out of output. The slash b tells the command to check only from the beginning
of the line and the last part is what string I am looking at. The output now looks a lot
cleaner with only the information that I wanted. That’s it for remote management. Used correctly
in your organization it can quickly reduce the amount of time you spend performing maintenance
on computers. In the next video I will look at Folder Virtualzation.
Thanks for watching this completely free video on Windows 7. For more free videos,
study guides and exam questions see our web page. Otherwise you can always watch all of
our videos on are you tube channel.