Hamburger Icon
  • Labs icon Lab
  • Core Tech
Google Cloud Platform icon
Labs

Build a PowerShell Tool for Windows Event and Text Log Analysis

In this lab, you’ll practice building a PowerShell tool to analyze Windows event logs and text files. When you’re finished, you’ll have a functioning script to scan activity in a given timeframe.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 2h 0m
Published
Clock icon Sep 12, 2024

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Getting Started in the Lab Environment

    Here are the initial instructions and explanation of the lab environment. Read this while your environment is busy creating itself from nothing. Yes, this violates physics; we know. How fun!

  2. Challenge

    Brainstorm and Sketch Out a Tool

    You will start to create a PowerShell script to audit a server.

  3. Challenge

    Use Get-WinEvent to Query Window Event Logs

    Explore the full event logs, and then gradually apply filters to retrieve specific logs, understanding why filtering is crucial.

  4. Challenge

    Find Local Storage Volumes

    Learn how to filter local drives by root paths, and search recursively for specific file types within those drives.

  5. Challenge

    Search all Local Storage Volumes for Log Files

    Using Get-ChildItem, learn how to interrogate text log files on your local storage volumes.

  6. Challenge

    Add Script Parameters

    Make the tool more dynamic by creating a holistic script that runs together with parameters.

  7. Challenge

    Add CSV Output

    In this challenge, you will learn to export the records found into a CSV file, rather than just outputting them via the console. Saving to a CSV file will allow you to quickly parse and share the results of your script with others.

  8. Challenge

    Add Simple Error Handling

    In this final challenge, you will learn to incorporate basic error handling into your tool. You’ll learn about the $Error variable, non-terminating and terminating errors.

Adam Bertram is an independent consultant, technical writer, trainer, and presenter. Adam specializes in consulting and evangelizing all things IT automation, mainly focused around Windows PowerShell.

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.