In modern enterprise environments, log management is critical for security monitoring, compliance auditing, and troubleshooting. Manually checking Event Viewer logs on dozens of disparate workstations or servers is inefficient and prone to human error. Windows Event Forwarding (WEF) provides a robust, built-in solution to aggregate events from multiple sources into a single central collector without requiring third-party agents. This guide walks IT students, junior engineers, and practitioners through the configuration of WEF using PowerShell and native Windows tools.
Before proceeding, ensure your environment meets these prerequisites:
* Operating System: All machines must be running Windows Server 2016 or later (which includes WEF capabilities), or Windows 10/11 with the “Event Forwarding” feature installed via Optional Features.
* Network Connectivity: The Collector server and all Subscribers (source PCs) must be able to communicate over TCP port 5985 (HTTP) or 5986 (HTTPS). For this guide, we will use unencrypted HTTP on port 5985 for simplicity in a trusted lab environment.
* Authentication: The Collector and Subscribers should be part of the same domain or have mutual authentication configured. We will assume an Active Directory domain environment where users can run administrative commands.
Understanding the Architecture: Collector vs. Subscriber
Windows Event Forwarding operates on a client-server model. The machine that receives and stores logs is called the Collector. The machines sending logs are Subscribers.
In a typical scenario, you might have a Domain Controller or a dedicated SIEM (Security Information and Event Management) server acting as the Collector. Your workstations and application servers act as Subscribers. When an event occurs on a Subscriber—such as a failed login attempt (Event ID 4625)—it is forwarded immediately to the Collector’s Microsoft-WinEvent-LogCollector service, which stores it in the local Application Event Log.
Installing Required Features
The first step is ensuring the WEF feature is present on both the Collector and Subscribers. Open an elevated PowerShell window (Run as Administrator) and execute the following command:
Add-WindowsFeature -Name Windows-EventForwarding -IncludeManagementTools
On the Collector, you must also install the specific subscription management tools if not included in the core install:
Install-WindowsFeature -Name EventLogCollectorService
Verify installation by checking the feature status:
Get-WindowsFeature | Select-Object Name, Installed
Configuring the Collector Server
Once features are installed, the Collector needs to be ready to accept logs. By default, the service might not start automatically if the feature install was recent, so ensure it is running:
Set-Service -Name EventLogCollectorService -StartupType Automatic
Start-Service -Name EventLogCollectorService
You can verify the service status with Get-Service EventLogCollectorService. It should return Running and Automatic. Next, create a subscription that listens for specific events. We will configure the Collector to listen for all system security events.
Defining Subscriptions on the Collector
Use the New-WinEventForwardingSubscription cmdlet to define what logs you want to receive. This is the core of centralization.
$subscription = New-WinEventForwardingSubscription -Name "AllSecurityEvents" -Enabled $true -LogType Application, System, Security
This command creates a subscription named “AllSecurityEvents” that captures data from the Application, System, and Security logs. You can further filter by Event ID, Level, or Provider if needed using parameters like -EventId or -FilterXPath.
After creating the subscription, you must apply it to the event collector service:
Enable-WinEventForwardingSubscription -SubscriptionName "AllSecurityEvents"
Configuring Subscribers (Source PCs)
Now, move to the workstations (Subscribers). These machines need to know where to send their logs. You can do this via Group Policy or manually using PowerShell. For a manual approach on a specific PC:
- Open an elevated PowerShell window.
- Add the same WEF feature if missing (as shown in the previous section).
- Create a subscription entry pointing to your Collector’s IP address or FQDN.
$collectorIP = "192.168.1.50" # Replace with your actual collector IP
$sub = New-WinEventForwardingSubscription -Name "CentralLogs" -Enabled $true -LogType Application, System, Security
Add-WinEventForwardingSubscriptionToService -Subscription $sub -TargetUri ($collectorIP + ":5985")
This command configures the local machine to forward logs to 192.168.1.50 on port 5985. Restart the event forwarding service on the subscriber:
Restart-Service -Name EventLogCollectorService
Verification and Testing
Configuration is useless without verification. The most reliable way to test WEF is to generate an event on a Subscriber and watch it appear on the Collector.
Test Scenario:
1. On a Subscriber PC, open Command Prompt as Administrator.
2. Run: wevtutil qe Application /f | findstr "Application" (This just queries logs).
3. Instead, trigger a specific event. For example, force a failed login or simply check if the forwarding channel is active using:
Get-WinEventForwardingSubscription -TargetUri "192.168.1.50:5985" | Select-Object Name, Enabled
On the Collector, open Event Viewer (eventvwr.msc). Navigate to Applications and Services Logs -> Microsoft -> Windows -> EventLog-Collector. You should see an entry indicating that a subscription was applied. To actively test data flow, generate an event on the Subscriber:
# This creates a custom event in the System log on the subscriber
New-EventLog -LogName "Application" -Source "TestWEF" -EntryType "Information" -Message "WEF Test Event from Subscriber PC"
Wait a few seconds, then refresh the Collector’s Event Viewer. You should see an entry in the EventLog-Collector log corresponding to this event. If you do not see it immediately, check the network firewall between the machines; port 5985 must be open.
Common Errors and Troubleshooting
-
Error: “Cannot connect to destination”
- Cause: Firewall blocking port 5985 or incorrect IP/FQDN.
- Fix: Ensure Windows Firewall allows inbound traffic on 5985 for the
EventLogCollectorService. UseTest-NetConnection -ComputerName <CollectorIP> -Port 5985to verify connectivity.
-
Error: “Subscription not found”
- Cause: The subscription name or URI is misspelled, or the service hasn’t restarted after configuration changes.
- Fix: Re-run the
Add-WinEventForwardingSubscriptionToServicecommand and restart the service.
-
Logs Not Appearing
- Cause: The event level or type filter is too restrictive.
- Fix: Check the
-LogTypeparameter in your subscription definition. Ensure it matches the logs you are trying to forward (e.g., “Security” vs “System”).
Practical Application for Students and Engineers
For IT students, this exercise demonstrates how automation replaces manual spreadsheet tracking of server health. In an industry context, this setup forms the backbone of a basic SIEM. You can expand this by using PowerShell Desired State Configuration (DSC) to push these configurations automatically to hundreds of machines, ensuring consistency across your infrastructure.
Remember that while WEF is powerful, it is not a silver bullet for high-volume log ingestion in massive data centers; specialized tools may be needed there. However, for mid-sized networks or departmental monitoring, Windows Event Forwarding offers a secure, native, and cost-effective solution to centralize your digital footprint analysis. Always consult your organization’s security policies before forwarding sensitive logs, as some jurisdictions have strict requirements on where log data can reside.
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.

