The Objective of The Lab Is To Explore Some of The Functions of Powershell
The Objective of The Lab Is To Explore Some of The Functions of Powershell
Objectives
The objective of the lab is to explore
some of the functions of PowerShell.
Part 1: Access PowerShell console.
Part 2: Explore Command Prompt
and PowerShell commands.
Part 3: Explore cmdlets.
Part 4: Explore the netstat
command using PowerShell.
Part 5: Empty recycle bin using
PowerShell.
Background / Scenario
PowerShell is a powerful automation
tool. It is both a command console and
a scripting language. In this lab, you
will use the console to execute some
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 27 www.netacad.com
Lab - Using Windows PowerShell
CommandTypeNameVersionSourc
e
---------------------------
-
Aliasdir -> Get-ChildItem
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 27 www.netacad.com
Lab - Using Windows PowerShell
Question:
What is the PowerShell command for
dir?
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 27 www.netacad.com
Lab - Using Windows PowerShell
Ans: Get-Children
Type your answers here.
b. For more detailed information
about cmdlets, perform an internet
search for Microsoft powershell
cmdlets.
c. Close the Command Prompt
window when done.
Part 4: Explore the netstat command
using PowerShell.
a. At the PowerShell prompt, enter
netstat -h to see the options
available for the netstat command.
PS C:\Users\CyberOpsUser>
netstat -h
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 27 www.netacad.com
Lab - Using Windows PowerShell
Displays protocol
statistics and current
TCP/IP network connections.
listening port is
displayed. In this case the
executable name is in [] at
the bottom, on top is the
component it called, and so
forth until TCP/IP was
reached. Note that this
option can be time-
consuming and will fail
unless you have sufficient
permissions.
<some output omitted>
b. To display the routing table with
the active routes, enter netstat -r at
the prompt.
PS C:\Users\CyberOpsUser>
netstat -r
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 27 www.netacad.com
Lab - Using Windows PowerShell
===========================
===========================
=====================
Interface List
3...08 00 27 a0 c3
53 ......Intel(R) PRO/1000
MT Desktop Adapter
10...08 00 27 26 c1
78 ......Intel(R) PRO/1000
MT Desktop Adapter #2
1..........................
.Software Loopback
Interface 1
===========================
===========================
=====================
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 27 www.netacad.com
Lab - Using Windows PowerShell
===========================
===========================
=====================
Active Routes:
Network Destination Netmask
Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1
192.168.1.5 25
127.0.0.0
255.0.0.0 On-link
127.0.0.1 331
127.0.0.1
255.255.255.255 On-
link 127.0.0.1
331
127.255.255.255
255.255.255.255 On-
link 127.0.0.1
331
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 27 www.netacad.com
Lab - Using Windows PowerShell
169.254.0.0
255.255.0.0 On-link
169.254.181.151 281
169.254.181.151
255.255.255.255 On-
link 169.254.181.151
281
169.254.255.255
255.255.255.255 On-
link 169.254.181.151
281
192.168.1.0
255.255.255.0 On-
link 192.168.1.5
281
192.168.1.5
255.255.255.255 On-
link 192.168.1.5
281
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 15 of 27 www.netacad.com
Lab - Using Windows PowerShell
192.168.1.255
255.255.255.255 On-
link 192.168.1.5
281
224.0.0.0
240.0.0.0 On-link
127.0.0.1 331
224.0.0.0
240.0.0.0 On-link
192.168.1.5 281
224.0.0.0
240.0.0.0 On-link
169.254.181.151 281
255.255.255.255
255.255.255.255 On-
link 127.0.0.1
331
255.255.255.255
255.255.255.255 On-
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 16 of 27 www.netacad.com
Lab - Using Windows PowerShell
link 192.168.1.5
281
255.255.255.255
255.255.255.255 On-
link 169.254.181.151
281
===========================
===========================
=====================
Persistent Routes:
None
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 17 of 27 www.netacad.com
Lab - Using Windows PowerShell
1 331 ::1/128
On-link
3 281 fe80::/64
On-link
10 281 fe80::/64
On-link
10 281
fe80::408b:14a4:7b64:b597/1
28
On-link
3 281
fe80::dd67:9e98:9ce0:51e/12
8
On-link
1 331 ff00::/8
On-link
3 281 ff00::/8
On-link
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 18 of 27 www.netacad.com
Lab - Using Windows PowerShell
10 281 ff00::/8
On-link
===========================
===========================
=====================
Persistent Routes:
None
Question:
What is the IPv4 gateway?
Ans: 192.168.1.1
Type your answers here.
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 19 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 20 of 27 www.netacad.com
Lab - Using Windows PowerShell
Active Connections
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 21 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 22 of 27 www.netacad.com
Lab - Using Windows PowerShell
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 23 of 27 www.netacad.com
Lab - Using Windows PowerShell
Question:
What information can you get from
the Details tab and the Properties
dialog box for your selected PID?
Ans: PID 756 được liên kết với
svchost.exe. User cho quá trình
này là NETWORK SERVICE và nó
đang sử dụng 4132K bộ nhớ.
Type your answers here.
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 24 of 27 www.netacad.com
Lab - Using Windows PowerShell
Confirm
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 25 of 27 www.netacad.com
Lab - Using Windows PowerShell
End of document
2017 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 27 of 27 www.netacad.com