• No results found

Lab B: Finding and Running Basic Commands

In document TrainerHandbook (Page 48-51)

Scenario

You are preparing to complete several administrative tasks by using Windows PowerShell. You have to discover commands that will be used in performing those tasks, run several commands to begin performing those tasks, and learn about new Windows PowerShell features that will enable you to complete those tasks.

Objectives

After completing this lab, students will be able to:

 Discover new Windows PowerShell commands

 Execute basic Windows PowerShell commands

 Use Windows PowerShell “About” topics to learn new shell concepts and techniques

Lab Setup

Estimated Time: 45 minutes

Virtual Machines: 10961B-LON-DC1, 10961B-LON-CL1 User Name: ADATUM\Administrator

Password: Pa$$w0rd

For this lab, you will use the available virtual machine environment. Before you begin the lab, you must follow these steps:

1. On the host computer, move the pointer over the bottom left corner of the taskbar, click Start, and then click Hyper-V Manager on the Start screen.

2. In Hyper-V® Manager, click 10961B-LON-DC1, and in the Actions pane, click Start.

3. In the Actions pane, click Connect. Wait until the virtual machine starts.

4. Sign in by using the following credentials:

o User name: Administrator o Password: Pa$$w0rd o Domain: ADATUM

5. Repeat steps 2 through 4 for 10961B-LON-CL1.

6. The lab steps should be performed on the 10961B-LON-CL1 virtual machine.

Exercise 1: Finding Commands

Scenario

In this exercise, you will use Windows PowerShell’s Help (or Get-Help) and Get-Command commands to discover new commands capable of completing specific tasks within the shell.

In your tasks, italicized terms are intended to be keyword clues to help you complete the task.

There is only one task for this exercise:

 Find commands that will accomplish specified tasks

MCT USE ONL Y. STUDENT USE PROHIBITED

10961B: Automating Administration with Windows PowerShell 01-27

 Task 1: Find commands that will accomplish specified tasks

On the 10961B-LON-CL1 virtual machine, log on as Adatum\Administrator and determine answers to the following questions:

1. What command would you run to resolve a DNS name?

2. What command would you run to make changes to a network adapter? After finding a command that would make changes to a network adapter, what parameter would you use to change its MAC Address (on adapters that support having their MAC address changed)?

3. What command would let you enable a previously disabled scheduled task?

4. What command would let you block access to a file share by a particular user?

5. What command would you run to clear your computer’s local BranchCache cache?

6. What command would you run to display a list of Windows Firewall rules? What parameter of that command would display only enabled rules?

7. What command would you run to display a list of all locally bound IP addresses?

8. What command would you run to suspend an active print job in a print queue?

9. What native Windows PowerShell command would you run to format a new disk volume?

Results: After completing this exercise, you will have demonstrated your ability to use the command discoverability features of Windows PowerShell to find new commands that perform specific tasks.

Exercise 2: Finding and Running Commands

Scenario

In this exercise, you will run several basic Windows PowerShell commands. In some instances, you may have to find the commands that you will use to complete the task.

There is only one task for this exercise:

 Run commands to accomplish specified tasks

 Task 1: Run commands to accomplish specified tasks

1. On the 10961B-LON-CL1 virtual machine, while logged on as Adatum\Administrator, determine answers for the following questions:

2. Display a list of enabled Windows Firewall rules.

3. Display a list of all local IPv4 addresses.

4. Set the startup type of the BITS service to Automatic.

1. Open the Computer Management console and go to Services and Applications.

2. Locate the Background Intelligence Transfer Service (BITS) and note its startup type setting prior to and after changing the startup type in Windows PowerShell.

3. Test the network connection to the computer named LON-DC1. Your command should return only a True or False value, without any other output.

4. Display the newest 10 entries from the local Security event log.

MCT USE ONL Y. STUDENT USE PROHIBITED

01-28 Getting Started with Windows PowerShell

Results: After completing this exercise, you will have demonstrated your ability to run Windows PowerShell commands by using correct command-line syntax.

Exercise 3: Using "About" Files

Scenario

In this exercise, you will use Help discovery techniques to find content in “About” files, and use that content to answer questions about global Windows PowerShell functionality.

Words in italic are intended as clues. Remember that you have to use Help (or Get-Help) and wildcard characters. Because “About” files are not commands, Get-Command will not be useful in this exercise.

The main tasks for this exercise are as follows:

1. Locate and read "About" Help files 2. To prepare for the next module

 Task 1: Locate and read "About" Help files

1. Ensure you are still on the 10961B-LON-CL1 virtual machine logged on as Adatum\Administrator from the previous exercise, and answer the following questions:

2. What comparison operator does Windows PowerShell use for wildcard string comparisons?

3. Are Windows PowerShell comparison operators typically case-sensitive?

4. How would you use $Env to display the COMPUTERNAME environment variable?

5. What external command could be used to create a self-signed digital certificate usable for signing Windows PowerShell scripts?

 Task 2: To prepare for the next module

When you have finished the lab, revert the virtual machines to their initial state. To do this, perform the following steps:

1. On the host computer, start Hyper-V Manager.

2. In the Virtual Machines list, right click 10961B-LON-DC1, and then click Revert.

3. In the Revert Virtual Machine dialog box, click Revert.

4. Repeat steps 2 and 3 for 10961B-LON-CL1

Results: After completing this exercise, you will have demonstrated your ability to locate Help content in

“About” files.

Question: What is the main difference between Get-Help and Get-Command?

MCT USE ONL Y. STUDENT USE PROHIBITED

10961B: Automating Administration with Windows PowerShell 01-29

In document TrainerHandbook (Page 48-51)

Related documents