0% found this document useful (0 votes)
2 views

commands basic

The document outlines a practice lab for managing a Windows device using the Command Line Interface, specifically for the CompTIA A+ certification. It includes exercises on command-line navigation, networking tools, disk management, and system management, with a total duration of approximately 1 hour and 30 minutes. The lab provides hands-on experience with various command-line tools and their applications in a Windows environment.

Uploaded by

rgb9284
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

commands basic

The document outlines a practice lab for managing a Windows device using the Command Line Interface, specifically for the CompTIA A+ certification. It includes exercises on command-line navigation, networking tools, disk management, and system management, with a total duration of approximately 1 hour and 30 minutes. The lab provides hands-on experience with various command-line tools and their applications in a Windows environment.

Uploaded by

rgb9284
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 106

12/10/24, 12:53 PM Practice Labs | Print

CompTIA | 220-1102: CompTIA A+


Managing a Windows Device using the Command
Line Interface
Exercises
Introduction
Lab Topology
Exercise 1 - Command-Line Navigation Tools
Exercise 2 - Networking Command-Line Tools
Exercise 3 - Disk Management Command-Line Tools
Exercise 4 - System Management Command-Line Tools
Review

Introduction
Tags: A+ Navigation Commands Dir Command-Line Tools
Networking Commands Ipconfig Nslookup Chkdsk Copy Gpupdate

Welcome to the Managing a Windows Device using the Command Line


Interface Practice Lab. In this module, you will be provided with the instructions
and devices needed to develop your hands-on skills.

Learning Outcomes
In this module, you will complete the following exercises:

Exercise 1 - Command-Line Navigation Tools


Exercise 2 - Networking Command-Line Tools
Exercise 3 - Disk Management Command-Line Tools
Exercise 4 - System Management Command-Line Tools

After completing this module, you should be able to use:

Navigation Commands
The Ipconfig Command
The Ping Command
The Hostname Command
The Netstat Command
https://www.practice-labs.com/app/platform/print.aspx 1/106
12/10/24, 12:53 PM Practice Labs | Print

The Nslookup Command


The Net Use Command
The Net User Command
The Tracert Command
The Pathping Command
The Chkdsk Command
The Format Command
The Copy Command
The Xcopy Command
The Robocopy Command
The Sfc Command
The Diskpart Command
The Gpupdate Command
The Gpresult Command
The Shutdown Command
[Command Name] /?
The Winver Command

Exam Objectives
The following exam objectives are covered in this module:

1.2 Given a scenario, use the appropriate Microsoft Command-line tool

Navigation
Command-line tools

Lab Duration
It will take approximately 1 hour and 30 minutes to complete this lab.

The completion time of this module exceeds our usual 1-hour timeframe.
Please ensure you have taken into consideration how long this module will
take to complete.

Help and Support


For more information on using Practice Labs, please see our Help and Support
page. You can also raise a technical support ticket from this page.

Click Next to view the Lab topology used in this module.

https://www.practice-labs.com/app/platform/print.aspx 2/106
12/10/24, 12:53 PM Practice Labs | Print

https://www.practice-labs.com/app/platform/print.aspx 3/106
12/10/24, 12:53 PM Practice Labs | Print

Lab Topology
During your session, you will have access to the following lab configuration.

Depending on the exercises, you may or may not use all of the devices, but they
are shown here in the layout to get an overall understanding of the topology of
the lab.

PLABDC01 - (Windows Server 2019 - Domain Controller)


PLABWIN10 - (Windows 10 - Domain Member Workstation)
PLABWIN11 - (Windows 11 - Domain Member Workstation)
PLABSUSE - (SUSE - Standalone Server)
PLABUBUNTU - (Ubuntu - Standalone Server)
PLABANDROID - (Android OS - Android Device)

Click Next to proceed to the first exercise.

https://www.practice-labs.com/app/platform/print.aspx 4/106
12/10/24, 12:53 PM Practice Labs | Print

Exercise 1 - Command-Line Navigation Tools


Microsoft command-line tools are meant to automate certain tasks. These
commands are generally used by administrators of the system, not so much by
the general user.

These commands automate tasks by entities such as scripts and batch files. The
nature of the tasks performed is not routine but slightly complex. It is more
related to altering the structure of an operating system rather than merely using
it.

In this exercise, you will learn to use common navigation commands.

Learning Outcomes
After completing this exercise, you should be able to use:

Navigation Commands

Your Devices
You will be using the following devices in this lab. Please power these on now.

PLABDC01 - (Windows Server 2019 - Domain Controller)


PLABWIN10 - (Windows 10 - Domain Member Workstation)

Task 1 - Navigation Commands


Navigation commands are used to work with the directory and sub-directories,
as well as their structural aspects. These commands are used to explore the
hierarchy of directories and subdirectories, as well as set the path to the
directory or sub-directory within which these commands will be executed.

In this task, you will learn to use the navigation commands.

Step 1
Connect to PLABWIN10.

Click on the Start charm and type:

Command Prompt

Select Command Prompt from the Best Match pop-up menu.

https://www.practice-labs.com/app/platform/print.aspx 5/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 1.1 Screenshot of PLABWIN10: Displaying selecting Command Prompt from the Best Match pop-up
menu.

Step 2
In the Administrator: Command Prompt window, type the following command:

dir

Press Enter.

This command is used to view the directories and subdirectories inside your
current directory.

https://www.practice-labs.com/app/platform/print.aspx 6/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 1.2 Screenshot of PLABWIN10: Displaying the command to view the directories and subdirectories
entered and executed in the Administrator: Command Prompt window.

Step 3
Clear the Command Prompt window by typing the following command:

cls

Press Enter.

You can also set a directory to be the current directory. Type the following
command and press Enter:

cd downloads

Note: The command will take you to the \Downloads subdirectory in the C
drive.

https://www.practice-labs.com/app/platform/print.aspx 7/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 1.3 Screenshot of PLABWIN10: Displaying the command to navigate to set a directory as the
current directory entered and executed.

Step 4
Notice the command prompt now changes to include the \Downloads
subdirectory. This indicates that you are in the Users>administrator>Downloads
directory.

Type the following command and press Enter:

d:

Note: To navigate to a directory that is in a particular drive, you will first


need to set the drive name as the current drive. To do this, type the drive
letter of the desired drive followed by a colon. Notice that the current drive
is now D:\>.

https://www.practice-labs.com/app/platform/print.aspx 8/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 1.4 Screenshot of PLABWIN10: Displaying the command to navigate to a particular drive entered
and executed.

Step 5
You can view the files and folder of another directory from your current location
by using the dir command. To do this, provide the complete path of the directory
to view.

For example, to view all the files and directories in the


C:\users\administrator\downloads directory, type the following command:

dir c:\users\administrator\downloads /ah

Press Enter.

The /a parameter, along with the /h attribute, displays all hidden files and
directories in the specified subdirectory.

https://www.practice-labs.com/app/platform/print.aspx 9/106
12/10/24, 12:53 PM Practice Labs | Print

Note: You can clear the Command Prompt window by entering the cls
command.

Figure 1.5 Screenshot of PLABWIN10: Displaying the command to view the files and folder of another
directory from the current location entered and executed.

Note: The number of free bytes displayed in your lab might differ from the
screenshot.

Step 6
Similarly, you can view a specific set of files under a directory, including the
subdirectories.

For example, to view all the executable files in the c:\windows\*.exe directory,
type the following command:

dir c:\windows\*.exe /s /b

https://www.practice-labs.com/app/platform/print.aspx 10/106
12/10/24, 12:53 PM Practice Labs | Print

Press Enter.

Press Ctrl+ C to break the command.

Figure 1.6 Screenshot of PLABWIN10: Displaying the command to view a specific set of files under a
directory, including the subdirectories entered and executed.

Note: The /s parameter displays all files with the matching criteria in the
parent and subdirectories. The /b parameter displays only the path and the
file names, which makes the output more readable.

Step 7
To navigate back to the original location, which
was C:\Users\Administrator\Downloads, type the following command:

c:

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 11/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 1.7 Screenshot of PLABWIN10: Displaying typing the required command to navigate back to the
original location.

Step 8
Type the following command and press Enter:

cd..

This command moves you up one directory. Notice you are now up onto the
C:\Users\administrator location, which is one level up the from the earlier
C:\users\administrator\downloads directory.

https://www.practice-labs.com/app/platform/print.aspx 12/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 1.8 Screenshot of PLABWIN10: Displaying typing the required command to navigate back to the
original location.

Keep the Administrator: Command Prompt window open.

Note: You can clear the Command Prompt window by entering the cls
command.

Leave all devices in their current state and proceed to the next exercise.

https://www.practice-labs.com/app/platform/print.aspx 13/106
12/10/24, 12:53 PM Practice Labs | Print

Exercise 2 - Networking Command-Line Tools


The command prompt on a Windows device can be used to configure or display
a device’s networking settings. This is achieved by typing the commands in the
chosen window.

In this exercise, you will learn to use common networking commands.

Learning Outcomes
After completing this exercise, you should be able to use:

The Ipconfig Command


The Ping Command
The Hostname Command
The Netstat Command
The Nslookup Command
The Net Use Command
The Net User Command
The Tracert Command
The Pathping Command

Your Devices
You will be using the following devices in this lab. Please power these on now.

PLABDC01 - (Windows Server 2019 - Domain Controller)


PLABWIN10 - (Windows 10 - Domain Member Workstation)
PLABWIN11 - (Windows 11 - Domain Member Workstation)

Task 1 - The Ipconfig Command


The ipconfig command allows you to view a few network-related parameters.
Those parameters are - IP address, subnet mask, and default gateway. These
parameters are all related to the network to which your system is connected.
Each of them has a specific address as their value.

In this task, you will learn to use the ipconfig command.

Step 1
Ensure you are connected to PLABWIN10 and the Administrator: Command
Prompt window is open.

Type the following command and press Enter:


https://www.practice-labs.com/app/platform/print.aspx 14/106
12/10/24, 12:53 PM Practice Labs | Print

ipconfig

Figure 2.1 Screenshot of PLABWIN10: Displaying typing and executing the ipconfig command in the
Administrator: Command Prompt window.

Note: The IP address(es) assigned to the local system is displayed.

Step 2
To view the complete details of the network adapter, type the following
command:

ipconfig /all

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 15/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.2 Screenshot of PLABWIN10: Displaying the command to view the complete details of the IP
addresses on the system entered and executed.

Note: Notice that the output reveals information, such as DNS and DHCP
server IP addresses. A DNS server is required for name resolution. A DHCP
server leases IP addresses to the systems on the network.

Step 3
Type the following command and press Enter:

ipconfig /flushdns

https://www.practice-labs.com/app/platform/print.aspx 16/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.3 Screenshot of PLABWIN10: Displaying the command to clear the DNS cache entered and
executed.

Note: The ipconfig /flushdns command clears the DNS cache.

Step 4
To re-register DNS names, type the following command:

ipconfig /registerdns

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 17/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.4 Screenshot of PLABWIN10: Displaying the command to re-register the DNS names entered and
executed.

Step 5
Type the following command and press Enter:

ipconfig /displaydns

https://www.practice-labs.com/app/platform/print.aspx 18/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.5 Screenshot of PLABWIN10: Displaying the command to view the DNS Resolver Cache entered
and executed.

Note: The ipconfig /displaydns command displays the DNS Resolver Cache.
You can scroll up to read the information from the DNS Resolver Cache.

Step 6
Type the following command and press Enter:

ipconfig /?

https://www.practice-labs.com/app/platform/print.aspx 19/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.6 Screenshot of PLABWIN10: Displaying entering and executing the required ipconfig command.

Note: Executing the ipconfig command with the /? parameter displays the
different other options available with this command.

Keep the Administrator: Command Prompt window open.

Task 2 - The Ping Command


The ping command is used to check the status of a network device or system on
the network. When you execute the ping command, it sends the Internet Control
Message Protocol (ICMP) Echo Request messages to the destination system. The
source system from which you sent the ICMP messages then waits for a
response from the destination system.

In this task, you will use the ping command.

Step 1
Ensure you are connected to PLABWIN10, where the Administrator: Command
Prompt window is open.
https://www.practice-labs.com/app/platform/print.aspx 20/106
12/10/24, 12:53 PM Practice Labs | Print

Type the following command and press Enter:

ping

Figure 2.7 Screenshot of PLABWIN10: Displaying executing the ping command in the Administrator:
Command Prompt window.

Note: All the parameters associated with the ping command are displayed.

Step 2
Type the following command:

ping -n 3 192.168.0.3

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 21/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.8 Screenshot of PLABWIN10: Displaying the command to send a pre-defined number of packets
to the mentioned IP address entered and executed.

Note: Here, the -n parameter is used with the ping command. The -
n parameter sends a pre-defined number of packets to the mentioned IP
address and requests the responses to be returned.

Step 3
You can also ping to the same device with its name. Type the following
command:

ping plabwin11

Press Enter.

Notice that the ping is successful.

https://www.practice-labs.com/app/platform/print.aspx 22/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.9 Screenshot of PLABWIN10: Displaying entering and executing the ping command.

Keep the Administrator: Command Prompt window open.

Task 3 - The Hostname Command


The hostname command is used to display the name of the operating host
machine. When operating with multiple machines, it is possible to forget which
one is currently being used.

In this task, you will use the hostname command to find the name of the virtual
machine being used.

Step 1
Ensure you are connected to PLABWIN10.

In the Administrator: Command Prompt window, type the following command:

hostname

https://www.practice-labs.com/app/platform/print.aspx 23/106
12/10/24, 12:53 PM Practice Labs | Print

Press Enter.

Figure 2.10 Screenshot of PLABWIN10: Displaying entering and executing the hostname command in the
Administrator: Command Prompt window.

Note: Notice within the Practice Labs virtual machine, this machine is
named "PLABWIN10".

Keep the Administrator: Command Prompt window open.

Task 4 - The Netstat Command


As the name suggests, the netstat command provides network-related statistics.
Various parameters can be used along with this command.

In this task, you will learn to use the netstat command.

Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.

https://www.practice-labs.com/app/platform/print.aspx 24/106
12/10/24, 12:53 PM Practice Labs | Print

To view the output of the netstat command without any parameter, type the
following command:

netstat

Press Enter.

Figure 2.11 Screenshot of PLABWIN10: Displaying the output of the netstat command without any
parameter in the Administrator: Command Prompt window.

Note: The netstat command shows all the active Transmission Control
Protocol (TCP) connections and their state.
The Transmission Control Protocol (TCP) connection is a reliable, ordered
delivery of a stream of bytes, which are sent from one system to another
system on the network. It is the core protocol being used in World Wide Web
and applications, such as E-mail. The User Datagram Protocol (UDP) does
not provide reliable data service but utilizes reduced latency.

https://www.practice-labs.com/app/platform/print.aspx 25/106
12/10/24, 12:53 PM Practice Labs | Print

Step 2
Type the following command and press Enter:

netstat -o

Figure 2.12 Screenshot of PLABWIN10: Displaying the command to view the state of the TCP connections
entered and executed.

Note: The netstat command with the o parameter is used to view the state
of all TCP connections with each connection's Process ID (PID). Please note
that the output can vary from what’s displayed on the screenshot.

Step 3
To view the information about a particular protocol, such as TCP, type the
following command:

https://www.practice-labs.com/app/platform/print.aspx 26/106
12/10/24, 12:53 PM Practice Labs | Print

netstat -s -p tcp

Press Enter.

You may need to wait a few minutes for this to process.

Note: Please note the output will vary from what's shown in the screenshot.
The active connections present will differ at the time this command is
executed.

Step 4
To update the connection statistics every few seconds, such as 5 seconds, type
the following command:

netstat -e -t 5

https://www.practice-labs.com/app/platform/print.aspx 27/106
12/10/24, 12:53 PM Practice Labs | Print

Press Enter.

The command will continue to generate the output.

Press Ctrl+C to break the command.

Figure 2.14 Screenshot of PLABWIN10: Displaying the command to update the connection statistics every
5 seconds entered and executed.

Step 5
Type the following command and press Enter:

netstat -a

https://www.practice-labs.com/app/platform/print.aspx 28/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.15 Screenshot of PLABWIN10: Displaying the command to list all TCP and UDP connections
entered and executed.

Note: The netstat command with the a parameter will list all the TCP and
UDP connections. Notice in the screenshot that there are TCP and UDP
connections.

Keep the Administrator: Command Prompt window open.

Task 5 - The Nslookup Command


The nslookup command displays information that is useful for identifying issues
related to the domain name system (DNS). This command can be used with
different parameters. Each version of the command displays a specific set of
information, which highlights a specific aspect of a domain name system.

In this task, you will learn to use the nslookup command.

Step 1

https://www.practice-labs.com/app/platform/print.aspx 29/106
12/10/24, 12:53 PM Practice Labs | Print

Ensure you are connected to PLABWIN10, where the Administrator: Command


Prompt window is open.

You can use the nslookup command without any parameters. Type the following
command and press Enter:

nslookup

Notice that the command expects inputs from the user.

For the time being, press the Ctrl+C keys to break the command.

Figure 2.16 Screenshot of PLABWIN10: Displaying executing the nslookup command without any
parameters in the Administrator: Command Prompt window.

Step 2
To find the A record for a domain, type the following command:

nslookup practicelabs.com

https://www.practice-labs.com/app/platform/print.aspx 30/106
12/10/24, 12:53 PM Practice Labs | Print

Press Enter.

Figure 2.17 Screenshot of PLABWIN10: Displaying the command to find the A record for a domain entered
and executed.

Step 3
Type the following command and press Enter:

nslookup -type=ns practicelabs.com

https://www.practice-labs.com/app/platform/print.aspx 31/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.18 Screenshot of PLABWIN10: Displaying the command to find the NS record for a domain
entered and executed.

Note: The above command will find the NS (nameserver) record for a
domain.

Step 4
Next, type the following command and press Enter:

nslookup -type=soa practicelabs.com

https://www.practice-labs.com/app/platform/print.aspx 32/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.19 Screenshot of PLABWIN10: Displaying the command to query the SOA record for a domain
entered and executed.

Note: The above nslookup command entered will query the SOA (Start of
Authority) record for a domain.

Step 5
To find all DNS records for a domain, type the following command:

nslookup -type=any practicelabs.com

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 33/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.20 Screenshot of PLABWIN10: Displaying the command to find all DNS records for a domain
entered and executed.

Step 6
To use a specific DNS server for a domain, type the following command:

nslookup practicelabs.com plabdc01.practicelabs.com

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 34/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.21Screenshot of PLABWIN10: Displaying entering and executing the command to use a specific
DNS server for a domain.

Step 7
To perform a reverse lookup from an IP address, type the following command:

nslookup 192.168.0.1

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 35/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.22 Screenshot of PLABWIN10: Displaying the command to perform a reverse lookup from an IP
address entered and executed.

Step 8
Type the following command and press Enter:

nslookup -timeout=200 practicelabs.com

https://www.practice-labs.com/app/platform/print.aspx 36/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.23 Screenshot of PLABWIN10: Displaying the command to increase the timeout limit entered and
executed.

Note: The above nslookup command will increase the timeout value limit.

Step 9
Type the following command and press Enter:

nslookup -debug practicelabs.com

https://www.practice-labs.com/app/platform/print.aspx 37/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.24 Screenshot of PLABWIN10: Displaying the output when using the -debug parameter along
with the nslookup command.

Note: The nslookup command used with the -debug parameter will
generate questions and answers with detailed information.

Keep the Administrator: Command Prompt window open.

Task 6 - The Net Use Command


The net use command is used to connect your computer system to a shared
folder/drive on the network. Using this command, it's possible to have direct
access to the shared directory, treating it as if it were a local directory/drive.

There are many variations of this command. Each variation allows you to
determine some aspect of your connection with the folder/drive on the network.

In this task, you will learn to use the net use command.

Step 1
https://www.practice-labs.com/app/platform/print.aspx 38/106
12/10/24, 12:53 PM Practice Labs | Print

Ensure you are connected to PLABWIN10.

In the Administrator: Command Prompt window, type the following command


and press Enter:

net use z:

Figure 2.25 Screenshot of PLABWIN10: Displaying the command to view the existing network connection
that has been mapped to a drive letter entered and executed in the Administrator: Command Prompt
window.

Note: You can use the net use command to view the existing network
connection that has been mapped to a drive letter on your system.

Step 2
You can also map a network share or drive to a specific drive letter on your
system. To do this, type the following command:

https://www.practice-labs.com/app/platform/print.aspx 39/106
12/10/24, 12:53 PM Practice Labs | Print

net use x: \\plabwin11\c$ /persistent:yes

Press Enter.

Figure 2.26 Screenshot of PLABWIN10: Displaying the command to map a network share or drive to a
specific drive letter typed in.

Note: You have mapped the x drive of the local system with the
\\plabwin11\c$ drive. The /persistent parameter can have either a
yes or no value. The value of yes means that the mapping will be available
when you log on to the system next time. The value of no means that the
mapping is limited to this session only.

Step 3
Minimize the Administrator: Command Prompt window.

Click the File Explorer icon on the Windows Taskbar.

https://www.practice-labs.com/app/platform/print.aspx 40/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.27 Screenshot of PLABWIN10: Displaying opening File Explorer from the taskbar.

Step 4
In the File Explorer window, on the left pane, scroll down and
verify c$ (\\plabwin11) is now mapped to the drive letter X.

Click on the drive letter X. Notice its contents are displayed in the right pane.

https://www.practice-labs.com/app/platform/print.aspx 41/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.28 Screenshot of PLABWIN10: Displaying selecting c$ (\\plabwin11) in the File Explorer window.

Step 5
Close the File Explorer window.

Restore the Administrator: Command Prompt window.

You will now delete the drive mapping. To do this, type the following command:

net use x: /delete

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 42/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.29 Screenshot of PLABWIN10: Displaying the command to delete the drive mapping typed in.

Note: The drive mapping is now deleted successfully.

Keep the Administrator: Command Prompt window open.

Task 7 - The Net User Command


The net user command allows you to perform user account-related tasks on the
computer. This command allows you to create a new user, as well as modify the
user account-related parameters.

The net user command has various parameters that can be used. Each one of
them performs a specific task. Using this command, you can manage local and
domain-based user accounts.

In this task, you will learn to use the net user command.

Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.
https://www.practice-labs.com/app/platform/print.aspx 43/106
12/10/24, 12:53 PM Practice Labs | Print

To view the list of users on the local system, type the following command:

net user

Press Enter.

Figure 2.30 Screenshot of PLABWIN10: Displaying the command to view the list of users on the local
system entered and executed.

Step 2
Type the following command and press Enter:

net user /?

https://www.practice-labs.com/app/platform/print.aspx 44/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.31 Screenshot of PLABWIN10: Displaying the command to view the syntax of the net user
command entered and executed.

Note: The above net user command is used to view the syntax and the list
of parameters that can be used with the command.

Step 3
To view the information about a specific user account on the local system, type
the following command:

net user administrator

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 45/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.32 Screenshot of PLABWIN10: Displaying the command to view the information about a specific
user account on the local system entered and executed.

Step 4
To create a new account with the name Louis, type the following command:

net user Louis Passw0rd /add /times:ALL

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 46/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.33 Screenshot of PLABWIN10: Displaying the command to create a new account name entered
and executed.

Note: Notice that you are defining the new user account name as Louis. The
Password is Passw0rd. The /add parameter adds the user account, and the
user is configured to log in all days of the week.

Step 5
To view the list of users on the local system, type the following command:

net user

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 47/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.34 Screenshot of PLABWIN10: Displaying entering and executing the command to view the list of
users on the local system.

Note: Notice the new user account Louis has been added successfully.
Similar to creating a local account, you can also create a domain account by
adding the /<domain name> parameter.

Step 6
To delete the user Louis, type the following command:

net user Louis /delete

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 48/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.35 Screenshot of PLABWIN10: Displaying entering and executing the command to delete the user
named Louis.

Note: If prompted for confirmation, click Allow Access.

Step 7
To verify that the user account Louis is deleted, type the following command:

net user

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 49/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.36 Screenshot of PLABWIN10: Displaying entering and executing the command to verify the
deletion of the user named Louis.

Note: Notice that the user account, Louis, is now deleted. It does not
appear in the list.

Keep the Administrator: Command Prompt window open.

Task 8 - The Tracert Command


The tracert command is used to trace the path of an IP (Internet Protocol)
packet. A packet has a destination address, along with the initial count, which is
set to 1. Each device along the network path increases the count by one. The
network devices are called nodes. When the result is shown, it contains the hop
count, as well as the node information.

In this task, you will learn to use the tracert command.

Step 1

https://www.practice-labs.com/app/platform/print.aspx 50/106
12/10/24, 12:53 PM Practice Labs | Print

Ensure you are connected to PLABWIN10, where the Administrator: Command


Prompt window is open.

To trace the path to a destination system, type the following command:

tracert 192.168.0.1

Press Enter.

Figure 2.37 Screenshot of PLABWIN10: Displaying entering and executing the tracert command in the
Administrator: Command Prompt window.

Note: Notice that the IP address is resolved to the device name.

Step 2
Type the following command and press Enter:

https://www.practice-labs.com/app/platform/print.aspx 51/106
12/10/24, 12:53 PM Practice Labs | Print

tracert -d 192.168.0.1

Figure 2.38 Screenshot of PLABWIN10: Displaying the command to trace the path to a device without
performing name resolution entered and executed.

Note: The tracert command used with the d parameter will trace the path to
a device without performing name resolution. Notice that the response is
much quicker.

Step 3
You can perform path tracing to a domain name or a specific server on the
Internet. Type the following command:

tracert -d 8.8.8.8

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 52/106
12/10/24, 12:53 PM Practice Labs | Print

Press Ctrl+C to break the command.

Figure 2.39 Screenshot of PLABWIN10: Displaying entering and executing the required tracert command.

Note: Some environments have firewall configurations that intentionally do


not respond to ICMP packets (the protocol used by tracert). This can be due
to security configurations. In this circumstance, the hop output is most likely
to be "* * * * Request timed out". Please run this command on your PC to
see an alternative result.

Step 4
You will now trace the path to the http://intranet Website. Type the following
command and press Enter:

tracert intranet

https://www.practice-labs.com/app/platform/print.aspx 53/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.40 Screenshot of PLABWIN10: Displaying the output after executing the command to trace the
path to the http://intranet Website.

Note: Notice that the first hop did not provide the information in a timely
manner. Then, the second hop was Intranet.

Step 5
Next, trace the path to the http://intranet website but with a defined timeout.
Type the following command and press Enter:

tracert -w 500 intranet

https://www.practice-labs.com/app/platform/print.aspx 54/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 2.41 Screenshot of PLABWIN10: Displaying the command to trace the path to the http://intranet
Website with a defined timeout entered and executed.

Note: Notice that the first hop did respond within the defined timeout. If
you still get the timeout error, this is an expected result as your Tracert is
hitting our firewall, which is causing the first timeout.

Keep the Administrator: Command Prompt window open.

Task 9 - The Pathping Command


The pathping command is used to provide information about latency between
the host machine and the destination.

In this task, you will learn how to use the pathping command.

Step 1
Ensure you are connected to PLABWIN10.

https://www.practice-labs.com/app/platform/print.aspx 55/106
12/10/24, 12:53 PM Practice Labs | Print

In the Administrator: Command Prompt window, type the following command


and press Enter:

pathping 8.8.8.8

Figure 2.42 Screenshot of PLABWIN10: Displaying entering and executing the pathping command in the
Administrator: Command Prompt window.

Note: Here, Google's famous DNS server is used as the target for the
pathping command. This may take a couple of minutes to complete. The
triple * indicates that the ICMP is blocked on the server where PLABWIN10
is on.

Keep the Administrator: Command Prompt window open.

Note: You can clear the Command Prompt window by entering the cls
command.

https://www.practice-labs.com/app/platform/print.aspx 56/106
12/10/24, 12:53 PM Practice Labs | Print

Leave all devices in their current state and proceed to the next exercise.

https://www.practice-labs.com/app/platform/print.aspx 57/106
12/10/24, 12:53 PM Practice Labs | Print

Exercise 3 - Disk Management Command-Line


Tools
Similar to the command prompt being used to view and configure the
networking settings for a device, it can also be used to configure the storage for
the device.

In this exercise, the different disk management command-line tool commands


will be explored.

Learning Outcomes
After completing this exercise, you should be able to:

The Chkdsk Command


The Format Command
The Copy Command
The Xcopy Command
The Robocopy Command
The Sfc Command
The Diskpart Command

Your Devices
You will be using the following devices in this lab. Please power these on now.

PLABDC01 - (Windows Server 2019 - Domain Controller)


PLABWIN10 - (Windows 10 - Domain Member Workstation)

Task 1 - The Chkdsk Command


The ckhdsk command scans the specified sector of a local hard disk drive or the
specified external storage device attached to the computer system. For
example, it could be a USB flash drive or a disk in a CD/DVD drive. This
command will mark the damaged/erroneous sector(s) as bad and will recover
the information contained by that sector(s), if still readable.

The command has various parameters that can be used along with it, which can
perform various tasks.

In this task, you will learn to use the chkdsk command.

Step 1

https://www.practice-labs.com/app/platform/print.aspx 58/106
12/10/24, 12:53 PM Practice Labs | Print

Ensure you are connected to PLABWIN10, where the Administrator: Command


Prompt window is open.

You can run the chkdsk command in read-only mode. To do this, type the
following command and press Enter:

chkdsk

Figure 3.1 Screenshot of PLABWIN10: Displaying the output of the chkdsk command in the Administrator:
Command Prompt window.

Note: Please note the Total Duration can vary from what’s shown in the
screenshot.

Step 2
Type the following command and press Enter:

https://www.practice-labs.com/app/platform/print.aspx 59/106
12/10/24, 12:53 PM Practice Labs | Print

chkdsk /C

Figure 3.2 Screenshot of PLABWIN10: Displaying entering and executing the chkdsk command with the /C
parameter.

Note: The chkdsk command with the /C parameter will skip checking cycles
in the folder structure. Please note the Total Duration can vary from what’s
shown in the screenshot.

Step 3
Next, type the following command and press Enter:

chkdsk c: /f /r

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 60/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.3 Screenshot of PLABWIN10: Displaying entering and executing the chkdsk command with the /f
and /r parameters.

Note: The /f parameter is used to fix hard drive errors. Along with this, you
can also use the /r parameter to locate bad sectors.

Step 4
When prompted for confirmation, type the following:

Press Enter.

Notice that the C drive will be checked on the next system restart.

Note: If time permits, you can restart the system right now and see the
check being performed.

https://www.practice-labs.com/app/platform/print.aspx 61/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.4 Screenshot of PLABWIN10: Displaying confirming the execution of the chkdsk command with
the /f parameter.

Keep the Administrator: Command Prompt window open.

Task 2 - The Format Command


The format command allows a user to format a selected partition. Once
formatted, the contents of that particular segment of the storage device are lost.
Hence, this command should be used with caution.

In this task, you will learn to use the format command.

Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.

To format the F drive, type the following command and press Enter:

format f: /q

https://www.practice-labs.com/app/platform/print.aspx 62/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.5 Screenshot of PLABWIN10: Displaying performing a quick format of the F drive in the
Administrator: Command Prompt window.

Note: Notice that you are prompted for the current volume label.

Step 2
Type the following volume label and press Enter:

PLABWIN10HDD2

https://www.practice-labs.com/app/platform/print.aspx 63/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.6 Screenshot of PLABWIN10: Displaying entering the existing volume label.

Step 3
Type the following to proceed with formatting the F drive:

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 64/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.7 Screenshot of PLABWIN10: Displaying confirming the formatting of the F drive.

Note: Notice that you are now prompted with the volume label.

Step 4
Type the following volume label and press Enter:

Data

https://www.practice-labs.com/app/platform/print.aspx 65/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.8 Screenshot of PLABWIN10: Displaying entering a new volume label and completing the
formatting of the drive.

Note: The F drive is now formatted.

Step 5
Minimize the Administrator: Command Prompt window.

Open File Explorer from the Windows Taskbar.

In the File Explorer window, notice that the F drive is now labeled as Data on
the left pane.

Close File Explorer.

https://www.practice-labs.com/app/platform/print.aspx 66/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.9 Screenshot of PLABWIN10: Displaying verifying the new volume label for F drive in File
Explorer.

Keep the Administrator: Command Prompt window open.

Task 3 - The Copy Command


The copy command allows you to copy a file from one location to another. The
other location is to be specified by you as a parameter while issuing the
command. The copy command keeps the original file as it is and creates another
instance of the file at the specified location.

In this task, you will learn to use the copy command.

Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.

You will first create an empty text file using a command. Remember that it is
easy to create a text file using Notepad but a bit tricky when using the
command prompt.

Type the following command and press Enter:


https://www.practice-labs.com/app/platform/print.aspx 67/106
12/10/24, 12:53 PM Practice Labs | Print

type NUL > ABCD.txt

Figure 3.10 Screenshot of PLABWIN10: Displaying creating an empty text file in the Administrator:
Command Prompt window.

Step 2
To verify if the file has been created, type the following command:

dir

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 68/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.11 Screenshot of PLABWIN10: Displaying listing the files in the current directory.

Note: A file named ABCD.txt is created, but it is empty.

Step 3
You will now copy the file named ABCD.txt from the current directory
to c:\Users.

Type the following command and press Enter:

copy ABCD.txt c:\Users

https://www.practice-labs.com/app/platform/print.aspx 69/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.12 Screenshot of PLABWIN10: Displaying entering and executing the command to copy the
ABCD.txt file to c:\Users.

Step 4
Whenever you attempt to copy a file to a destination and the same file exists,
you will be prompted with a warning. If the file exists in the destination
directory, you can still overwrite it without getting the warning.

To do this, type the following command and press Enter:

copy /Y ABCD.txt c:\Users

https://www.practice-labs.com/app/platform/print.aspx 70/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.13 Screenshot of PLABWIN10: Displaying entering and executing the copy command with the /Y
parameter.

Note: The /Y parameter in the copy command suppresses the prompt for
confirmation to overwrite a file.

Keep the Administrator: Command Prompt window open.

Task 4 - The Xcopy Command


The xcopy command is used to copy the files, as well as directories, from their
source location to the specified location. The specified location is a parameter
passed by the user. While copying a directory, this command also copies its sub-
directories, if present.

In this task, you will learn to use the xcopy command.

Step 1
Ensure you are connected to PLABWIN10.

https://www.practice-labs.com/app/platform/print.aspx 71/106
12/10/24, 12:53 PM Practice Labs | Print

In the Administrator: Command Prompt window, type the following command


and press Enter:

xcopy /Y *.txt c:\Users

Figure 3.14 Screenshot of PLABWIN10: Copying all text files in the current directory to the Downloads
directory using the xcopy command.

Note: The xcopy command will copy all text files in the current directory to
the Downloads directory.

Minimize the Administrator: Command Prompt window.

Step 2
Open File Explorer from the Windows Taskbar.

Select and right-click the Local Disk (C:) drive on the left pane.

Click New > Folder. Name the new folder as:


https://www.practice-labs.com/app/platform/print.aspx 72/106
12/10/24, 12:53 PM Practice Labs | Print

PLAB

Figure 3.15 Screenshot of PLABWIN10: Displaying creating a new folder in File Explorer.

Step 3
Navigate inside the PLAB directory and create two directories and one text file.

Right-click anywhere on the details pane and select New > Folder.

Name the first folder:

Test1

Name the second folder:

Test2

https://www.practice-labs.com/app/platform/print.aspx 73/106
12/10/24, 12:53 PM Practice Labs | Print

Then, right-click and click New > Text Document.

Name the text file:

PLAB1

Figure 3.16 Screenshot of PLABWIN10: Displaying creating a directory, sub-directories, and a text file in
File Explorer.

Close File Explorer.

Step 4
Restore the Administrator: Command Prompt window from the Taskbar.

You will now copy the PLAB directory, including empty sub-directories and text
file, to the Downloads directory.

Type the following command and press Enter:

https://www.practice-labs.com/app/platform/print.aspx 74/106
12/10/24, 12:53 PM Practice Labs | Print

xcopy c:\PLAB Downloads /e

Figure 3.17 Screenshot of PLABWIN10: Displaying copying the PLAB directory, including empty sub-
directories and text file, to the Downloads directory.

Note: Notice that the text file is now copied to the Downloads folder.

Step 5
To verify if the sub-directories and text file have been copied to
the Downloads directory, type the following command:

dir Downloads

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 75/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.18 Screenshot of PLABWIN10: Displaying verifying if the sub-directories and text file have been
copied to the Downloads directory.

Note: Notice that the sub-directories and text file are now copied to
the Downloads folder.

Keep the Administrator: Command Prompt window open.

Task 5 - The Robocopy Command


The robocopy command copies file data. The necessary parameters must be
passed in the command itself, such as the source directory, destination
directory, and file whose contents are to be copied.

Robocopy will keep the original files and create a replica at the specified
location.

In this task, you will learn to use the robocopy command.

Step 1
https://www.practice-labs.com/app/platform/print.aspx 76/106
12/10/24, 12:53 PM Practice Labs | Print

In PLABWIN10, the Administrator: Command Prompt window is open.

To copy the Downloads directory files and sub-directories to c:\Users, type the
following command:

robocopy Downloads c:\Users

Press Enter.

Figure 3.19 Screenshot of PLABWIN10: Displaying copying the Downloads directory files and sub-
directories to c:\Users using the robocopy command in Administrator: Command Prompt window.

Keep the Administrator: Command Prompt window open.

Task 6 - The Sfc Command


SFC is short for System File Checker. As the name indicates, it performs fault
identification and corrections of system files. If some system functions are not
working or the operating system is crashing, you can use sfc to detect issues and
perform corrective measures.

https://www.practice-labs.com/app/platform/print.aspx 77/106
12/10/24, 12:53 PM Practice Labs | Print

In this task, you will learn to use the sfc command.

Step 1
Ensure you are connected to PLABWIN10.

In the Administrator: Command Prompt window, type the following command


and press Enter:

sfc /scannow

This command may take longer than 10-20 minutes to complete. If you
would like to skip this step, please press Ctrl + c and move to the next step.

Figure 3.20 Screenshot of PLABWIN10: Displaying entering and executing the sfc command in the
Administrator: Command Prompt window.

Note: The /scannow parameter of the sfc command checks the protected
system files and repairs them if required. Notice that there were integrity
https://www.practice-labs.com/app/platform/print.aspx 78/106
12/10/24, 12:53 PM Practice Labs | Print

issues encountered, which have been repaired successfully.

Step 2
You can use the sfc command to repair a specific file. Type the following
command and press Enter.:

sfc /scanfile=c:\windows\system32\ieframe.dll

This process may take a few minutes.

Figure 3.21 Screenshot of PLABWIN10: Displaying repairing a file with the sfc command.

Note: Notice that no integrity violations are reported.

Step 3
Type the following command:
https://www.practice-labs.com/app/platform/print.aspx 79/106
12/10/24, 12:53 PM Practice Labs | Print

sfc /verifyonly

Press Enter.

This process runs for quite a long time. It may take more than an hour to
complete. For this task, you can break the command by pressing Ctrl+C.

Figure 3.22 Screenshot of PLABWIN10: Displaying verifying the protected files using the /verifyonly
parameter with the sfc command.

Note: You can use the /verifyonly parameter with the sfc command to
verify the protected files.

Keep the Administrator: Command Prompt window open.

Task 7 - The Diskpart Command

https://www.practice-labs.com/app/platform/print.aspx 80/106
12/10/24, 12:53 PM Practice Labs | Print

The diskpart command is used to perform partitioning activities. If you want to


create a new primary partition inside one of your existing drives, or if you want
to delete a particular drive of your storage device, it can be done using the
diskpart command.

In short, the diskpart command allows you to create, delete, and resize the
partitions of your hard disk drive(s), as well as your external storage device's
drive(s).

In this task, you will learn to use the diskpart command.

Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.

The set of commands mentioned below will get you to a specific disk of the
machine's hard drive. Once you reach there, a number of different activities,
such as creating a primary partition, can be performed.

To start diskpart, type the following command and press Enter:

diskpart

https://www.practice-labs.com/app/platform/print.aspx 81/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.23 Screenshot of PLABWIN10: Displaying entering and executing the command to start the
diskpart shell.

Step 2
Type the following command and press Enter:

list disk

https://www.practice-labs.com/app/platform/print.aspx 82/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.24 Screenshot of PLABWIN10: Displaying entering and executing the command to list the
available disks in the system.

Note: The list disk command will list the available disks in the system.

Step 3
To select a disk, type the following command:

select disk 1

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 83/106
12/10/24, 12:53 PM Practice Labs | Print

Step 4
To list the available disks in the system, type the following command and
press Enter:

list disk

https://www.practice-labs.com/app/platform/print.aspx 84/106
12/10/24, 12:53 PM Practice Labs | Print

Note: Notice that the selected disk has an * (asterisk) before it.

Step 5
To list the partitions on the selected disk, type the following command and
press Enter:

list partition

https://www.practice-labs.com/app/platform/print.aspx 85/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.27 Screenshot of PLABWIN10: Displaying entering and executing the command to list the
partitions on the selected disks.

Step 6
To select a partition, type the following command and press Enter:

select partition 2

https://www.practice-labs.com/app/platform/print.aspx 86/106
12/10/24, 12:53 PM Practice Labs | Print

Step 7
To make the partition active, type the following command:

active

Press Enter.

https://www.practice-labs.com/app/platform/print.aspx 87/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.29 Screenshot of PLABWIN10: Displaying entering and executing the command to make a
partition active.

Note: Notice the message that the partition cannot be marked as ACTIVE
because it is not a fixed MBR disk.

Step 8
You will need to quick format the partition with the NTFS file system and then
assign drive letter F to it.

Type the following command and press Enter:

Format FS=NTFS label=F quick

https://www.practice-labs.com/app/platform/print.aspx 88/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.30 Screenshot of PLABWIN10: Displaying entering and executing the command to perform a
quick format of the selected partition.

Step 9
To exit from diskpart, type the following command and press Enter:

exit

You are back on the command prompt.

Note: You can get the list of commands by invoking diskpart and then
typing help.

https://www.practice-labs.com/app/platform/print.aspx 89/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 3.31 Screenshot of PLABWIN10: Displaying entering and executing the command to exit from the
diskpart shell.

Keep the Administrator: Command Prompt window open.

Note: You can clear the Command Prompt window by entering the cls
command.

Leave all devices in their current state and proceed to the next exercise.

https://www.practice-labs.com/app/platform/print.aspx 90/106
12/10/24, 12:53 PM Practice Labs | Print

Exercise 4 - System Management Command-Line


Tools
The command prompt windows provide the functionality to manage specific
device system configurations.

In this exercise, the different command-line tools to manage a system’s


configuration will be explored.

Learning Outcomes
After completing this exercise, you should be able to use:

The Gpupdate Command


The Gpresult Command
The Shutdown Command
[Command Name] /?
The Winver Command

Your Devices
You will be using the following devices in this lab. Please power these on now.

PLABDC01 - (Windows Server 2019 - Domain Controller)


PLABWIN10 - (Windows 10 - Domain Member Workstation)

Task 1 - The Gpupdate Command


An individual user or a machine has a certain set of domains and local policies
applied to it. A policy could be local or domain-based. When a domain-based
policy is created, it takes a while before the policy is applied to the systems on
the network.

A user can run the gpupdate (group policy update) command on the local
system to apply the policy. The recipient system must be part of the domain in
which the policy is created.

In this task, you will learn to use the gpupdate command.

Step 1
Ensure you are connected to PLABWIN10, where the Administrator: Command
Prompt window is open.

https://www.practice-labs.com/app/platform/print.aspx 91/106
12/10/24, 12:53 PM Practice Labs | Print

To run the gpupdate command without any parameter, type the following
command:

gpupdate

Press Enter.

Figure 4.1 Screenshot of PLABWIN10: Displaying entering and executing the gpupdate command without
any parameter.

Step 2
To apply all the policies, not only the ones that have changed, type the following
command and press Enter:

gpupdate /force

https://www.practice-labs.com/app/platform/print.aspx 92/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 4.2 Screenshot of PLABWIN10: Displaying entering and executing the command to apply all
policies.

Step 3
When you run the gpupdate command, user and computer policies are applied
by default. You can also choose to apply either user or computer.

Type the following command and press Enter:

gpupdate /Target:User

https://www.practice-labs.com/app/platform/print.aspx 93/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 4.3 Screenshot of PLABWIN10: Displaying the command to update a specific set of policies entered
and executed.

Note: If you provide a blank space after the colon, the command will not
run. Instead, it will show the help for gpupdate.

Step 4
The default number of seconds to wait for policy processing is 600 seconds. You
can remove the wait time.

To do this, type the following command and press Enter:

gpupdate /Wait:0

https://www.practice-labs.com/app/platform/print.aspx 94/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 4.4 Screenshot of PLABWIN10: Displaying the command to remove the wait time for the policy
update entered and executed.

Keep the Administrator: Command Prompt window open.

Task 2 - The Gpresult Command


For each user or the machine, there is a set of policies that get applied. These
policies are about how the application programs and resources based on the
network and the operating system behave for that particular user or a computer.

These policies can overlap in nature. The gpresult command generates the
resultant set of the applicable policies after considering the overlapping.

In this task, you will learn to use the gpresult command.

Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.

To display the RSoP summary data, type the following command and
press Enter:

https://www.practice-labs.com/app/platform/print.aspx 95/106
12/10/24, 12:53 PM Practice Labs | Print

gpresult /r

Figure 4.5 Screenshot of PLABWIN10: Displaying entering and executing the gpresult command with the
/r parameter.

Note: The output of this command spans multiple pages. You will need to
scroll and read the information. The screenshot below displays the
information from the start of the output of the command.

Step 2
To display all the information about the Group Policy, type the following
command and press Enter:

gpresult /z

https://www.practice-labs.com/app/platform/print.aspx 96/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 4.6 Screenshot of PLABWIN10: Displaying the command to view the information about Group
Policy entered and executed.

Note: The output of this command spans multiple pages. You will need to
scroll and read the information. The screenshot below displays the
information from the start of the output of the command.

Keep the Administrator: Command Prompt window open.

Task 3 - [Command Name] /?


Even expert-level computer users need to occasionally reference a list of
command options, and there are too many commands and options to be
remembered. Within the Windows Command Line, finding help is as easy as
entering the name of the command and following with the "/?".

In this task, you will learn to reference a command's options list using
Command-Line.

Step 1
https://www.practice-labs.com/app/platform/print.aspx 97/106
12/10/24, 12:53 PM Practice Labs | Print

Ensure you are connected to PLABWIN10.

In the Administrator: Command Prompt window, type the following command


and press Enter:

ping /?

Figure 4.7 Screenshot of PLABWIN10: Displaying entering and executing the ping command with the
required parameter.

Note: The multiple options that can be used with the ping command are
listed. The ping command was used in this example, but this same syntax
can be used with other commands, such as "ipconfig /?".

Keep the Administrator: Command Prompt window open.

Task 4 - The Winver Command

https://www.practice-labs.com/app/platform/print.aspx 98/106
12/10/24, 12:53 PM Practice Labs | Print

The winver command lets you know the exact version of Windows being used on
the machine. The Windows version number can change over time as Windows
updates regularly, and this command allows you to see the current Windows
version being used.

In this task, you will learn to use the winver command.

Step 1
Ensure you are connected to PLABWIN10, where the Administrator: Command
Prompt window is open.

Type the following command and press Enter:

winver

Figure 4.8 Screenshot of PLABWIN10: Displaying the About Windows window.

Note: The About Windows window displays information about the current

https://www.practice-labs.com/app/platform/print.aspx 99/106
12/10/24, 12:53 PM Practice Labs | Print

Windows version being used, in this case: Windows 10 Pro - Version 21H1.

Click OK to close the About Windows window.

Keep the Administrator: Command Prompt window open.

Task 5 - The Shutdown Command


The shutdown command is used to shut down the machine or restart it. It can be
used for the local system, as well as for a remote system connected over the
network.

The limitation of the 'shutdown' command is that it can be used on one machine
at a time. If you want to use the command on multiple machines, then you have
to type the command the same number of times as your machine count.

In this task, you will learn to use the shutdown command.

Step 1
Ensure you are connected to PLABWIN10.

In the Administrator: Command Prompt window, type the following command


and press Enter:

shutdown /r

https://www.practice-labs.com/app/platform/print.aspx 100/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 4.9 Screenshot of PLABWIN10: Displaying the command to restart the system typed in.

Note: The shutdown command with the /r parameter will restart the
system.

Step 2
You are prompted with a message for signing out.

Click Close.

https://www.practice-labs.com/app/platform/print.aspx 101/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 4.10 Screenshot of PLABWIN10: Displaying clicking Close on the You're about to be signed out
message box.

Step 3
The PLABWIN10 device now reboots. You need to go to the Practice Labs
environment and invoke PLABWIN10 once again.

Open the Command Prompt window as shown in Exercise 1, Task 1, Step 1.

In the Administrator: Command Prompt window, to restart the system


immediately, type the following command and press Enter:

shutdown /r /t 0

https://www.practice-labs.com/app/platform/print.aspx 102/106
12/10/24, 12:53 PM Practice Labs | Print

Figure 4.11 Screenshot of PLABWIN10: Displaying entering and executing the shutdown command with
the required parameters.

Note: Notice this time you did not get a message dialog box. This is because
you had defined the restart with the value of 0, which means immediately
without a wait.

Keep all devices that you have powered on in their current state and
proceed to the review section.

https://www.practice-labs.com/app/platform/print.aspx 103/106
12/10/24, 12:53 PM Practice Labs | Print

Review
Well done, you have completed the Managing a Windows Device using the
Command Line Interface Practice Lab.

Summary
You completed the following exercises:

Exercise 1 - Command-Line Navigation Tools


Exercise 2 - Networking Command-Line Tools
Exercise 3 - Disk Management Command-Line Tools
Exercise 4 - System Management Command-Line Tools

You should now be able to use:

Navigation Commands
The Ipconfig Command
The Ping Command
The Hostname Command
The Netstat Command
The Nslookup Command
The Net Use Command
The Net User Command
The Tracert Command
The Pathping Command
The Chkdsk Command
The Format Command
The Copy Command
The Xcopy Command
The Robocopy Command
The Sfc Command
The Diskpart Command
The Gpupdate Command
The Gpresult Command
The Shutdown Command
[Command Name] /?
The Winver Command

Feedback

https://www.practice-labs.com/app/platform/print.aspx 104/106
12/10/24, 12:53 PM Practice Labs | Print

Shutdown all virtual machines used in this lab. Alternatively, you can log out
of the lab platform.

https://www.practice-labs.com/app/platform/print.aspx 105/106
12/10/24, 12:53 PM Practice Labs | Print

https://www.practice-labs.com/app/platform/print.aspx 106/106

You might also like