Lab 20 - PowerShell

Introduction

This lab walks you through the process of developing a script that in turn creates a webpage displaying statistics about your servers that every administrator should check daily. As such this relies on Chapter 19 pp. 694-704.

Lab Goals

Create a PowerShell script that performs the checking and verification processes found in the "Daily Maintenance" section. Have it produce an html page available on your IIS machine under the name of daily.html. It should have results for the following:

  1. Can users access data on file servers?
    1. Check to see if your file shares are available. Don't know where they are? Look it up in your documentation.
  2. Are the printer share(s) alive? What is their status? (e.g. online offline ...)
  3. Who has logged on in the last 24 hours.
  4. Can users access the internet?
  5. Verify Backups ... ok, we don't do backups for virtual machines through normal backup procedures, so we won't do this this time.
  6. Present Critical Events in event viewer.

Setup

Once you have created and tested the script, create a job that runs daily at 12:00 AM and put the output of your script in the root directory of your IIS server. I recommend that you do this using a share on your file server. I called mine www. Make sure Enterprise Admins have write permissions.

Your script must be signed by a certificate that is trusted by the server. I found that this site was useful: https://www.darkoperator.com/blog/2013/3/5/powershell-basics-execution-policy-part-1.html.

Show Me

  1. Run the script and show me the output.
  2. Show that the script is setup to run daily at 12:00 AM
  3. Show that the IIS server shows the output of the script.

WindowsAdministration/Lab20PowerShell (last edited 2017-11-07 23:37:07 by scot)