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

Lab_Module_9

The document provides lab instructions for automating Windows Server 2008 administration, covering various modules including Server Manager, Group Policy, Troubleshooting Pack, and Best Practices Analyzer cmdlets. Each module consists of exercises that guide users through tasks such as listing installed features, creating reports, troubleshooting issues, and exporting configurations. The labs are designed for systems administrators to enhance their skills in managing and configuring Windows Server environments effectively.

Uploaded by

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

Lab_Module_9

The document provides lab instructions for automating Windows Server 2008 administration, covering various modules including Server Manager, Group Policy, Troubleshooting Pack, and Best Practices Analyzer cmdlets. Each module consists of exercises that guide users through tasks such as listing installed features, creating reports, troubleshooting issues, and exporting configurations. The labs are designed for systems administrators to enhance their skills in managing and configuring Windows Server environments effectively.

Uploaded by

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

Lab Instructions: Automating Windows Server®

2008 Administration
Module 9

Contents:
i. Lab A: Using the Server Manager Cmdlets
a) Exercise 1: Listing All Currently Installed Features
b) Exercise 2: Comparing Objects
c) Exercise 3: Installing a New Server Feature
d) Exercise 4: Exporting Current Configuration to XML

ii. Lab B: Using the Group Policy Cmdlets


a) Exercise 1: Listing All Group Policy Objects in the Domain
b) Exercise 2: Creating a Text-Based Report
c) Exercise 3: Creating HTML Reports
d) Exercise 4: Backing Up All Group Policy Objects

iii. Lab C: Using the Troubleshooting Pack Cmdlets


a) Exercise 1: Importing the Troubleshooting Pack Module
b) Exercise 2: Solving an End-User Problem Interactively
c) Exercise 3: Solving a Problem Using Answer Files

IV Lab D: Using the Best Practices Analyzer Cmdlets


a) Exercise 1: Importing the Best Practices Module
b) Exercise 2: Viewing Existing Models
c) Exercise 3: Running a Best Practices Scan
V Lab E: Using the IIS Cmdlets
a) Exercise 1: Importing the IIS Module
b) Exercise 2: Creating a New Web Site
c) Exercise 3: Backing Up IIS
d) Exercise 4: Modifying Web Site Bindings
e) Exercise 5: Using the IIS PSDrive
a) Exercise 6: Restoring an IIS Configuration
Lab A: Using the Server Manager Cmdlets
Estimate time: 20 minutes
You work as a systems administrator, focusing on servers. You are configuring a new Windows
Server 2008 R2 file server. The server must meet a standard configuration, and you must provide
an audit trail of the final configuration in the form of an XML file.

Lab Setup
For this lab, you will use the available virtual machine environment. Before you begin the lab,
you must:
1. Start the AD virtual machine and then log on by using the following credentials:
• Username: NEWHORIZON\administrator
• Password: Passw0rd
2. On AD, open a Windows PowerShell session as Administrator.
3. On AD, open the Start menu. Under the Administrative Tools folder, open the Group Policy
Management Console.
4. In the left pane of the Group Policy Management Console, expand the forest and domain until
you see the Starter GPO folder. Select the Starter GPO folder by clicking on it.
5. In the right pane, click the Create Starter GPOs button to create the Starter GPOs.
6. Ensure that Windows PowerShell remoting is enabled on AD. If you completed the previous
labs in this course and have not shut down and discarded the changes in the virtual machines,
remoting will be enabled. If not, open a Windows PowerShell session on those two virtual
machines and run Enable-PSRemoting on each.
7. In Windows PowerShell, execute the following two commands:
• Set-ExecutionPolicy RemoteSigned
• Lab_09_Setup.ps1

Note: Some of the Group Policy Objects and DNS entries that this script will modify may
already exist in the virtual machine and you may receive and error saying so if you have used the
virtual machine during earlier modules and have not discarded those changes.

8. Ensure that the Windows Firewall is disabled on AD


Lab A: Exercise 1: Listing All Currently Installed Features

Scenario
You are configuring a new Windows Server 2008 R2 file server. Other administrators have been
using it for testing, so you don’t know what state it is in. You want to use the Server Manager
cmdlets in Windows PowerShell to discover how the server is currently configured.

The main tasks for this exercise are carried out on AD and are as follows:
1. Import the Windows Server Manager PowerShell module.
2. View the module contents.
3. View all installed server features using Windows PowerShell.

� Task 1: Import the Windows Server Manager PowerShell module


1. On AD, in Windows PowerShell, view the list of all available modules.
2. Import the Server Manager module into your PowerShell session.

� Task 2: View the module contents


• View the contents of the ServerManager module.

� Task 3: View all installed server features


1. Display the available and installed server features using Windows PowerShell and the Server
Manager cmdlets.
2. Display only the server features that have been installed using Windows PowerShell and the
Server Manager cmdlets.

Note: The Windows Feature object has a Boolean property called Installed that indicates
whether it is installed or not.

Results: After this exercise, you should have successfully loaded the ServerManager PowerShell
module, displayed the module contents, and viewed installed and available server features.

Lab A: Exercise 2: Comparing Objects

Scenario
You need to compare the current configuration against your corporate standard. The standard
configuration has been documented using the Export-Clixml cmdlet. You must compare the
feature configuration information in this file against the current configuration.

The main tasks for this exercise are carried out on AD and as follows:
1. Import an XML file with standard configuration information.
2. Compare the standard configuration to the current configuration using the Compare-Object
cmdlet.

� Task 1: Import the XML file


1. Import the TargetFeatures.xml file from the E:\Mod09\Labfiles folder, which was created
with Export-Clixml cmdlet, as the variable $target.
2. Create a variable that contains the current server feature configuration.

� Task 2: Compare the imported features with the current features


• Compare the installed property of the $target and $current objects using the Compare-Object
cmdlet. The $target variable is the reference object and $current is the difference object.

Note: The installed property should be the only thing that is different, but you can include other
property names to make the result more meaningful.

Results: After this exercise, you should be able to identify which server features need to be
installed and which need to be removed to bring the configuration into compliance.

Lab A: Exercise 3: Installing a New Server Feature

Scenario
To bring the server configuration into compliance, you need to install the missing server features.

The main task for this exercise is carried out on AD and is as follows:
1. Install the missing Windows Server features.

� Task 1: View cmdlet help


• View help and examples for the Add-WindowsFeature cmdlet.

� Task 2: Install missing features


• To install the missing features based on the comparison you did in Exercise 2, you could
simply make a written note of features installed in $target, but not installed in $current, and
manually use Add-WindowsFeature to install each one. You can also accomplish this task
using Windows PowerShell. Write a pipelined expression to install features that should be
installed but are not.

Note: Remember, you can use the –WhatIf common parameter with Add-WindowsFeature so
you can preview what the cmdlet would do without actually making any changes.

Results: After this exercise, you should have installed the server features that were installed in
the imported configuration but not in the current configuration.

Lab A: Exercise 4: Exporting Current Configuration to XML

Scenario
To provide an audit trail, you must export the current configuration to an XML file.

The main tasks for this exercise are carried out on AD and are as follows:
1. Verify the current configuration of installed features.
2. Create an XML file with information about the current feature configuration.

� Task 1: Verify the current configuration


• Using Windows PowerShell, display only the currently installed features, and make sure only
the following features are installed: File-Services, FS-FileServer, Windows-Internal-DB,
Backup-Features, Backup, Backup-
Tools, and WSRM.

� Task 2: Export configuration to XML


• Get all server features and export to a PowerShell XML file called AD-Features.xml. Store the
file in your documents folder.

Results: After this exercise, you should have created an XML file that contains the current and
now standardized, feature configuration.
Lab B: Using the Group Policy Cmdlets
Estimated time: 20 minutes

You are a Windows administrator responsible for managing Group Policy objects in your
domain. Your manager has asked for a report of all your Group Policy Objects. You manager
also wants to make sure that all Group Policy Objects are being backed up.
Lab B: Exercise 1: Listing All Group Policy Objects in the Domain Scenario

Your manager has asked for a report of all your Group Policy Objects. You will start this process
by gathering a list of all the Group Policy Objects in the domain.

The main tasks for this exercise are carried out on AD and are as follows:
1. Import the Group Policy PowerShell module.
2. View the module contents.
3. View all Group Policy objects using Windows PowerShell.

� Task 1: Import the Group Policy PowerShell module


1. Open Windows PowerShell and view the list of available modules.
2. Import the Group Policy module into your PowerShell session.

� Task 2: View the module contents


• View the contents of the Group Policy module.

� Task 3: View Group Policy objects


• Display all Group Policy objects in the domain using Windows PowerShell.

Results: After this exercise, you should have successfully loaded the GroupPolicy PowerShell
module, displayed the module contents, and viewed all Group Policy objects in the domain.
Exercise 2: Creating a Text-Based Report

Scenario
Your manager has asked for some brief, summary reports of the Group Policy objects in your
domain in a text file format.
The main tasks for this exercise are as follows:
1. Get selected information from all Group Policy objects in the domain.
2. Create a text file with this information.

� Task 1: Get selected Group Policy object properties


• Using Windows PowerShell, get all Group Policy objects for the domain displaying the GPO
name, when it was created, and when it was last modified.
The output should be sorted by the time the GPO was last modified.

Note: Group Policy objects in PowerShell are like any other object in that they have properties.
Use Get-Member to discover property names.

� Task 2: Create a text file report


• Collect the same information specified in the previous task and save the results to a text file
called GPOSummary.txt in \\AD\E$\Mod09\Labfiles.

Results: After this exercise, you should have a text file that displays selected properties about all
Group Policy objects in your domain.
Lab B: Exercise 3: Creating HTML Reports

Scenario
You need to document Group Policy objects for historical and audit purposes. Your manager has
also asked for a HTML-formatted report on the default domain policy.

The main tasks for this exercise are as follows:


1. Create an HTML report for the Default Domain policy.
2. Create an individual HTML report for each group policy object.

� Task 1: Create a default Domain Policy report


• Using Windows PowerShell, create an HTML report for the default domain policy called
DefaultDomainPolicy.htm and save it in your documents folder.

� Task 2: Create individual GPO reports


• Using a PowerShell expression, create individual HTML reports for each Group Policy object
and save them to \\AD\E$\Mod09\Labfiles. The filename should be in the format GPO display
name.htm.

Hint: You need to retrieve the GPOs, and then enumerate them by using ForEach- Object. Within the
ForEach-Object script block, use a GPO cmdlet that generates a GPO report. That cmdlet identifies the
GPOs by using an -id parameter; using $_.id for that parameter value will identify each GPO that you
enumerate.

Results: After this exercise, you should have html reports for every Group Policy object in the
domain.
Lab B: Exercise 4: Backing Up All Group Policy Objects

Scenario
For business continuity purposes it is critical that Group Policy objects are properly backed up
on a weekly basis. Your manager has asked you to develop a PowerShell solution you can run on
a weekly basis to back up all Group Policy objects.

The main task for this exercise is:


1. Back up a Group Policy Object individually and collectively.

� Task 1: Back up the Default Domain policy


• Using Windows PowerShell, create a local backup of the Default Domain policy to your
documents folder.

� Task 2: Back up all Group Policy objects


• Using Windows PowerShell, back up all group policy objects in the domain to
\\AD\E$\Mod09\Labfiles. Add the comment Weekly Backup to each backup.

Results: After this exercise, you should have backups of every Group Policy object in the
domain.
Lab C: Using the Troubleshooting Pack Cmdlets
Estimated time: 20 minutes
You work as a systems technician, troubleshooting problems with individual desktops. The help
desk manager has asked for your assistance in troubleshooting a desktop problem. She has heard
you can solve problems with Windows PowerShell and has asked for your assistance in learning
more.

Lab Setup
For this lab, you will use the available virtual machine environment. Before you begin the lab,
you must:
1. Start the AD virtual machine. You do not need to log on, but wait until the boot process is
complete.
2. Start the WINDOWS7 virtual machine, and then logon by using the following credentials:
• Username: NEWHORIZON\administrator
• Password: Passw0rd
3. Open a Windows PowerShell session on WINDOWS7.
Lab C: Exercise 1: Importing the Troubleshooting Pack Module

Scenario
Your company has standardized on Windows 7 as the client operating system which includes
PowerShell. You need to become familiar with PowerShell-based tools that you can use to
troubleshoot and resolve problems.
The main tasks for this exercise are carried out on WINDOWS7 and are as follows:
1. Import the Troubleshooting Pack PowerShell module.
2. View the module contents.

� Task 1: Import the Troubleshooting Pack PowerShell module


• On WINDOWS7, import the Troubleshooting Pack module into your PowerShell session.

� Task 2: View the module contents


• View the contents of the Troubleshooting Pack module.

Results: After this exercise, you will have successfully loaded the Troubleshooting Pack module
and know what cmdlets it offers.
Lab C: Exercise 2: Solving an End-User Problem Interactively

Scenario
Since you have to support Windows 7 clients, you plan to use Windows PowerShell to resolve
problems faster and more efficiently. There is an ongoing problem with the Windows Search
service. Using the Troubleshooting Pack cmdlets, your job is to find a way to identify this
problem and resolve it.
The main tasks for this exercise are:
1. Stop Windows search.
2. Run an interactive troubleshooting session.
3. View the report.

� Task 1: Stop Windows search


• To simulate the problem, use Windows PowerShell to stop the Windows Search service if it is
running.

� Task 2: Run an interactive troubleshooting session


1. Using the Search troubleshooting pack, run a troubleshooting session and save the results to
the current directory. When prompted, indicate that Files don’t appear in search results.
2. When prompted, allow the troubleshooter to fix the problem.

� Task 3: View the report


• Using Internet Explorer, view the contents of ResultReport.xml.

Results: After this exercise, you should have successfully run an interactive troubleshooting
session in Windows PowerShell and generated a report file.
Lab C: Exercise 3: Solving a Problem Using Answer Files

Scenario
You have a recurring problem that is relatively easy to resolve once it has been identified. You
want to develop an answer file for this problem so that if the suspected problem exists, you can
run the file so, the problem can be resolved quickly with minimal intervention on your part.
The main tasks for this exercise are as follows:
1. Create a troubleshooting pack answer file.
2. Use the answer file to resolve a problem.
3. Run a troubleshooting session unattended.

� Task 1: Create an answer file


• Create an answer file called SearchAnswer.xml in your documents folder for the Search
troubleshooting pack. When prompted, answer that Files Don’t Appear in Search Results. Leave
any other questions blank.

� Task 2: Invoke troubleshooting using the answer file


1. Using Windows PowerShell, stop the Windows Search service if it is running. This will
simulate the problem.
2. Use the answer file you created in Task 1 and invoke the Search troubleshooting pack. Do not
fix any problems when prompted.

� Task 3: Invoke troubleshooting unattended


• Using the answer file you created in Task 1, invoke the Search troubleshooting pack in
unattended mode.

� Task 4: Verify the solution


• Using Windows PowerShell, check the status of the Windows Search service and verify that it
is now running.
Results: After this exercise, you should have a troubleshooting answer file which you
have used interactively and unattended to troubleshoot and solve a problem.

Lab D: Using the Best Practices Analyzer


Cmdlets
Estimated time: 15 minutes
You work as a systems administrator, and you are responsible for a group of servers running
Windows Server 2008 R2. As part of your automated audit process, you want to prepare a series
of best practice reports depending on what server roles are installed.

Lab Setup
For this lab, you will use the available virtual machine environment. Before you begin the lab,
you must:
1. Start the AD virtual machine, and then log on by using the following credentials:
• Username: NEWHORIZON\administrator
• Password: Passw0rd
2. Open a Windows PowerShell session.
Lab D: Exercise 1: Importing the Best Practices Module

Scenario
As a Windows administrator, it is very important that your systems operate at peak efficiency
while remaining secure. As a company policy you closely follow Microsoft recommended best
practices. Windows PowerShell has a solution for analyzing your computers and network to see
if they meet their recommended best practices. You want to learn more about this.

The main tasks for this exercise are as follows:


1. Import the Best Practices PowerShell module.
2. View the module contents.

� Task 1: Import the Best Practices PowerShell module


1. Open Windows PowerShell and view the list of available modules.
2. Import the Best Practices module into your PowerShell session.

� Task 2: View the module contents


• View the contents of the Best Practices module.

Results: After this exercise, you should have successfully loaded the Best Practices PowerShell
module and displayed the module contents.
Lab D: Exercise 2: Viewing Existing Models

Scenario
In continuing your investigation of how PowerShell can help with analyzing best practices, you
need to discover what areas it can scan.

The main task for this exercise is:


1. Display all available best practice models.

� Task 1: Display all available best practice models


• In Windows PowerShell, display all the best practice models you can use.

Results: After this exercise, you should be able to identify which areas can be scanned for best
practices.
Lab D: Exercise 3: Running a Best Practices Scan

Scenario
Now that you know what areas you can scan, you decide to discover how well your systems
match up to the best practice model.

The main tasks for this exercise are as follows:


1. Run a best practices scan.
2. View the results.
3. Create a best practices scan report.

� Task 1: Run a best practices scan


• Using Windows PowerShell, run a best practices scan for Active Directory.

� Task 2: View the scan results


• Save the results of the Active Directory scan to a variable called $results and view the results.

� Task 3: View selected results


• Each item in a scan result has a Severity property. Using Windows PowerShell, display only
scan results from your last Active Directory scan that are of the Error type.

� Task 4: Create a best practices report


1. Using Windows PowerShell, run a best practices scan for Active Directory and generate an
HTML report capturing these properties: ResultID, Severity, Category, Title, Problem,
Impact, Resolution, and Compliance. The report should be sorted by Severity. Save the file to
your documents folder. Use the CSS file found in your lab folder to provide formatting.
2. Open Windows Internet Explorer® to view the file.
Results: After this exercise, you should have an HTML report that compares you current Active
Directory configuration to the Best Practices model.

Lab E: Using the IIS Cmdlets


Estimated time: 30 minutes
You are a Windows Administrator tasked with managing a small Web server used for internal
purposes. Your job includes creating and managing Web sites. Because your company charges
for internal IT services, you need to automate Web site management so that it can be done in the
most efficient manner possible.

Lab Setup
For this lab, you will use the available virtual machine environment. Before you begin the lab,
you must:
1. Start the AD virtual machine, and then log on by using the following credentials:
• Username: NEWHORIZON\administrator
• Password: Passw0rd
2. Open a Windows PowerShell session.
Lab E: Exercise 1: Importing the IIS Module

Scenario
Your job includes creating and managing Web sites. Because your company charges back for IT
services, you need to automate Web site management so that it can be done in the most efficient
manner possible. You have heard that you can manage IIS from Windows PowerShell and want
to learn more.

The main tasks for this exercise are as follows:


1. Import the IIS PowerShell module.
2. View the module contents.

� Task 1: Import the IIS PowerShell module


1. Open Windows PowerShell and view the list of available modules.
2. Import the IIS management module into your PowerShell session.

� Task 2: View the module contents


• View the contents of the IIS module.

Results: After this exercise, you should have successfully loaded the IIS PowerShell module and
displayed the module contents.
Lab E: Exercise 2: Creating a New Web Site

Scenario
You want to test the IIS cmdlets by creating a simple Web site. The main tasks for this exercise
are as follows:
1. Create a simple Web site using the IIS cmdlets.
2. View all web sites.
3. Verify the Web site.

� Task 1: Create a new Web site


1. Using the IIS cmdlets, create a new Web site using these settings:
a. Name: PowerShellDemo
b. Port: 80
c. Physical Path: %SystemDrive%\Inetpub\PowerShellDemo
2. Copy underconstruction.htm from the lab folder to the root of the new site as
default.htm.

� Task 2: View all Web sites


• Using Windows PowerShell and the IIS cmdlets, view all Web sites running on AD.

� Task 3: Verify the Web site


1. Using Windows PowerShell, stop the Default Web site if it is running.
2. Using Windows PowerShell, start the new PowerShellDemo site.
3. Open the AD Web server in Internet Explorer and verify you have reached the new site.

Results: After this exercise, you should be able to open the new Web site in Internet explorer
and view the default document.
Lab E: Exercise 3: Backing Up IIS

Scenario
Before making changes to IIS or Web site configurations, you need to have a backup. You want
to use the IIS cmdlets to back up your IIS configuration.

The main tasks for this exercise are as follows:


1. Back up your IIS configuration.
2. Verify the backup.

� Task 1: Back up IIS


• Using the IIS cmdlets, back up your IIS configuration with a name of Backup1.

� Task 2: Verify the backup


• Using the IIS cmdlets, verify the Backup1 backup you just created.

Results: After this exercise, you should have a verified backup of IIS. Lab Instructions: \
Lab E: Exercise 4: Modifying Web Site Bindings

Scenario
To provide additional security for your internal Web server, you want to change the binding from
the default port to a new port.

The main tasks for this exercise are as follows:


1. Display the current binding information for all Web sites.
2. Change the binding information for all sites to a new port.
3. Verify the site bindings have been changed.

� Task 1: Display current binding information for all Web sites


• Using the IIS cmdlets, display current binding settings for all Web sites on AD.

� Task 2: Change port binding


• Using Windows PowerShell, change the port binding for all Web sites on AD from port 80 to
port 8001. This includes the site using a host header.

� Task 3: Verify the new bindings


1. Using Windows PowerShell and the IIS cmdlets, view the new binding information.
2. Using Internet Explorer, connect to the PowerShell Demo site on AD using the new binding
information.

Results: After this exercise, you should have changed the default binding on all sites to 8001 and
verified the change.
Lab E: Exercise 5: Using the IIS PSDrive

Scenario
Because your Web server includes several sites, you do not want the default site to start
automatically. Using the IIS PSDrive, you need to reconfigure the site so that it does not start
automatically.

The main tasks for this exercise are as follows:


1. Use the IIS PSDrive to navigate through the site folder.
2. Display current properties for the default site.
3. Modify the default site so that it is not automatically started by the server.

� Task 1: Connect to the IIS PSDrive


1. Display all available PSDrives in your PowerShell session.
2. Change your PowerShell location to the root of your IIS PSDrive.

� Task 2: Navigate to the default site


• Within the IIS PS Drive, navigate to the folder that represents the Default Site.

� Task 3: Display all properties for the default site


• Using Windows PowerShell and the IIS PSDrive, display a list of all properties for the default
site.

Tip: Not all properties may be displayed by default.

� Task 4: Modify the default site


1. Using Windows PowerShell and the IIS PSDrive, modify the default site so that the site does
not start automatically.
2. Change your PowerShell location back to C:\.
Results: After this exercise, you should have navigated through the IIS PSDrive andmodified the
Default Web site so that it does not start automatically.
Lab E: Exercise 6: Restoring an IIS Configuration

Scenario
You realize you don’t want to keep the changes you’ve made so you wish to restore IIS to its
previous configuration.
The main tasks for this exercise are:
1. View all available IIS configuration backups.
2. Restore the most current IIS backup.

� Task 1: View existing backups


• Using Windows PowerShell and the IIS cmdlets, display all available IIS configuration
backups.

� Task 2: Restore the most recent configuration


• Using Windows PowerShell and the IIS cmdlets, restore the most recent IIS configuration.

Results: After this exercise, you should have restored IIS back to an earlier configuration with
all sites back on port 80. You can ignore any errors about denied access to
c:\windows\system32\inetserv\config\scheman\wsmanconfig_schema.xml.

You might also like