Windows Tips guides, explanations and reader checklists on whilenetworking.com

Configure Windows Event Forwarding Rules to Centralize Log Analysis Across Multiple Student Lab PCs

In modern IT education environments, managing dozens of student lab machines often feels like herding cats. When a critical security incident occurs or a…

In modern IT education environments, managing dozens of student lab machines often feels like herding cats. When a critical security incident occurs or a system failure happens across the network, administrators need immediate visibility into event logs from every affected machine. Relying on individual students to check local Event Viewer logs is inefficient and prone to human error. The robust solution lies in configuring Windows Event Forwarding (WEF) rules. This architecture allows multiple source computers to forward specific events directly to a central collector, providing a unified dashboard for monitoring and forensic analysis.

This guide walks IT students and junior engineers through the process of setting up WEF using PowerShell and native Windows features. We will cover prerequisites, step-by-step configuration, verification procedures, and common troubleshooting scenarios relevant to both academic labs and enterprise environments.

Understanding the Architecture and Prerequisites

Before diving into commands, it is essential to understand how Event Forwarding works. The architecture consists of three main components: Source Computers, a Forwarding Layer (often managed via Group Policy or a dedicated computer), and a Collector Computer. In a typical student lab scenario, you might designate one powerful workstation as the Collector where all logs aggregate.

To proceed successfully, ensure your environment meets these prerequisites:
* Windows Version: All machines must be running Windows 10 version 1803 or later, or Windows Server 2016 and above. Older versions lack the necessary WEF infrastructure.
* Network Connectivity: Source computers must have outbound access to the Collector’s IP address on port 5985 (HTTP) or 5986 (HTTPS).
* Administrative Privileges: You need local administrator rights on both the source and collector machines to create subscriptions and manage subscriptions.
* Time Synchronization: While not strictly required for forwarding, having synchronized time across all machines is best practice for accurate log correlation.

Installing Required Components via PowerShell

The most efficient way to configure WEF in a lab environment is using PowerShell, which allows for automation if you later move to a production Group Policy deployment. On the Collector machine, you first need to ensure the necessary Windows Features are installed.

Run the following command in an elevated PowerShell session (Right-click PowerShell > Run as Administrator) on the Collector:

Add-WindowsFeature -Name Windows-EventForwarding -IncludeManagementTools

Next, install the management tools which allow you to create subscriptions and manage sources remotely. This step is crucial; without it, the New-WEFSubscription cmdlet will not exist.

Once installed, restart the server if prompted. On the Source machines (the student PCs), you do not need to install extra features for basic forwarding, but installing the management tools locally helps with debugging if issues arise.

Creating the Subscription on the Collector

The core of WEF is the “Subscription,” which defines what events to collect and where to send them. On the Collector machine, open PowerShell as Administrator.

First, define the source computer by its name or IP address:

$source = "Student-Lab-PC01" # Replace with actual hostname or IP

Next, create a subscription that listens for critical security events (Event ID 4624 – Logon Success) and error-level system events. You can forward logs from multiple sources by adding them to the same subscription object later.

$subscription = New-WEFSubscription `
    -SourceComputer $source `
    -Query "*[System[(Level=1 or Level=2)]]*" `
    -FilterExpression "[System[(Level=1 or Level=2)]]" `
    -Destination "Collector-EventLog"

$subscription | Out-File C:\WEF_Subscriptions.json

Note: The query filters for events with a Severity level of 1 (Critical) or 2 (Error). This prevents the collector from being overwhelmed by benign informational logs.

Configuring Forwarding on Source Computers

Now that the Collector is ready, you must configure the source machines to push data. While WEF can be configured via Group Policy for enterprise fleets, PowerShell offers a direct method ideal for lab exercises where you control individual machines.

On each Source machine (e.g., Student-Lab-PC01), run the following command to create a remote subscription that points back to your Collector:

New-WEFSubscription `
    -ComputerName "Collector-EventLog" `
    -Destination "Collector-EventLog" `
    -Query "*[System[(Level=1 or Level=2)]]*" `
    -FilterExpression "[System[(Level=1 or Level=2)]]" `
    -SourceComputer "Student-Lab-PC01" | Out-Null

Correction for Accuracy: The standard WEF architecture usually involves installing the “Event Forwarding” role on a dedicated server (the Collector) and then configuring sources to forward to that server. The command above creates a subscription on the source side if using a specific topology, but typically, you define the subscription on the Collector using New-WEFSubscription with the -SourceComputer parameter pointing to the lab PC, and the source PC must have the “Event Forwarding” feature installed or be part of a domain where policies handle this.

Let’s refine the standard approach for a lab:
1. On the Collector, ensure it has the role.
2. On the Source, you generally do not run New-WEFSubscription. Instead, you configure the source to forward events defined in the Collector’s subscription. However, if you are using a standalone WEF setup without Active Directory Group Policy, you often install the “Event Forwarding” feature on sources too if they need to manage their own subscriptions.

For a pure lab scenario where you want to manually push configuration:
On the Source machine, ensure it can reach the Collector. Then, use the following logic (conceptually): The Collector defines the rule. The Source must have the “Event Forwarding” feature installed to act as a source in some configurations, but often sources are just standard clients.

Corrected Practical Step:
To make this work reliably in a lab without AD:
1. On Collector: Add-WindowsFeature Windows-EventForwarding
2. On Source: Ensure it can ping the Collector.
3. On Collector, run the subscription creation command targeting the Source hostname.
4. On Source, verify the “Event Forwarding” service is running (it usually starts automatically with the feature).

Verifying the Configuration and Expected Results

After configuring both ends, you must verify that data is flowing. The most reliable way to do this is on the Collector machine using Event Viewer or PowerShell.

Verification Step 1: Check Subscription Status
On the Collector, run:

Get-WEFSubscription -ComputerName "LocalHost" | Format-List *

You should see your subscription listed with a status of Active. If it shows Inactive, check network connectivity and firewall rules.

Verification Step 2: Check Event Viewer
Open Event Viewer on the Collector (eventvwr.msc). Navigate to Applications and Services Logs > Microsoft > Windows. You will see new sub-folders appear corresponding to your source machines (e.g., Student-Lab-PC01). Expand these folders to view the forwarded logs.

Illustrative Output:

Source: Student-Lab-PC01
Level: Error
Event ID: 4625 (Failed Logon Attempt)
Message: An authentication failure has been reported...

Seeing this log on the Collector confirms that the forwarding rule is active and capturing data from the remote PC.

Common Errors and Troubleshooting Fixes

Even in controlled lab environments, errors occur. Here are common pitfalls and their solutions.

Error 1: “Cannot connect to destination computer”
Cause: Firewall blocking port 5985 (HTTP) or 5986 (HTTPS).
Fix: On the Collector, open Windows Defender Firewall with Advanced Security. Create an inbound rule allowing TCP port 5985 from your lab network range. Alternatively, use HTTPS (port 5986) and configure certificates if security is a priority.

Error 2: “Subscription not found or inactive”
Cause: The source computer name changed (e.g., after a reboot) or the subscription was reset.
Fix: Re-run the New-WEFSubscription command on the Collector, ensuring the -SourceComputer parameter matches the exact current hostname of the student PC.

Error 3: Logs not appearing despite Active Status
Cause: The event query filter is too restrictive or the event level does not match.
Fix: Temporarily change the query to * to capture all events and verify flow. Then, narrow the query back down to specific Event IDs (e.g., *[System[EventID=4624]]) once connectivity is confirmed.

Student Practice Task: Build Your Own Lab Dashboard

To solidify your understanding, try this practical exercise:
1. Set up a dedicated “Collector” VM or PC with Windows Server or Windows 10 Pro.
2. Configure two other PCs as “Student Nodes.”
3. On the Collector, create a subscription that captures Event ID 1074 (Application Shutdown) and Event ID 6005 (Event Log Service Started).
4. Force an application shutdown on one of the Student Nodes using Task Manager.
5. Observe the log entry appearing on the Collector within seconds.

This exercise simulates real-world scenarios where IT professionals monitor for unauthorized software terminations or system restarts across a fleet of devices without needing to be physically present at each machine.

Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.