- Setting up a Source Initiated Subscription
- Setting up a source-initiated subscription where the event sources are in the same domain as the event collector computer
- Configuring the event source computer
- Configuring the event collector computer
- To validate that the subscription works correctly
- Forwarding the security log
- Setting up a source initiated subscription where the event sources are not in the same domain as the event collector computer
- Certificates requirements
- Setup the listener on the Event collector
- Configure certificate mapping on the Event Collector
- Event Source computer Configuration
- Adam the Automator
- How To Set Up Windows Event Log Forwarding In Windows Server 2016
- Jeff Christman
- Windows Event Log Forwarding Overview
- WEF Project Overview
- Environment and Knowledge Requirements
- Configuring the Event Log Collector
- Enabling WinRM on the Collector
- Starting the Subscription Collector Service
- Setting up the Forwarders’ GPO
- Allowing the Network Service to Read Event Logs
- Setting up a Subscription
- Verifying the WEF Configuration
- Your Takeaways
Setting up a Source Initiated Subscription
Source-initiated subscriptions allow you to define a subscription on an event collector computer without defining the event source computers, and then multiple remote event source computers can be set up (using a group policy setting) to forward events to the event collector computer. This differs from a collector initiated subscription because in the collector initiated subscription model, the event collector must define all the event sources in the event subscription.
When setting up a source-initiated subscription, consider whether the event source computers are in the same domain as the event collector computer. The following sections describe the steps to follow when the event sources are in the same domain or not in the same domain as the event collector computer.
Any computer in a domain, local or remote, can be an event collector. However, when choosing an event collector, it is important to select a machine that is topologically close to where the majority of the events will be generated. Sending events to a machine at a distant network location on a WAN can reduce overall performance and efficiency in event collection.
Setting up a source-initiated subscription where the event sources are in the same domain as the event collector computer
Both the event source computers and the event collector computer must be configured to set up a source initiated subscription.
These instructions assume that you have administrator access to the Windows Server domain controller serving the domain in which the remote computer or computers will be configured to collect events.
Configuring the event source computer
Run the following command from an elevated privilege command prompt on the Windows Server domain controller to configure Windows Remote Management:
winrm qc -q
Start group policy by running the following command:
%SYSTEMROOT%\System32\gpedit.msc
Under the Computer Configuration node, expand the Administrative Templates node, then expand the Windows Components node, then select the Event Forwarding node.
Right-click the SubscriptionManager setting, and select Properties. Enable the SubscriptionManager setting, and click the Show button to add a server address to the setting. Add at least one setting that specifies the event collector computer. The SubscriptionManager Properties window contains an Explain tab that describes the syntax for the setting.
After the SubscriptionManager setting has been added, run the following command to ensure the policy is applied:
gpupdate /force
Configuring the event collector computer
Run the following command from an elevated privilege command prompt on the Windows Server domain controller to configure Windows Remote Management:
winrm qc -q
Run the following command to configure the Event Collector service:
wecutil qc /q
Create a source initiated subscription. This can either be done programmatically, by using the Event Viewer, or by using Wecutil.exe. For more information about how to create the subscription programmatically, see the code example in Creating a Source Initiated Subscription. If you use Wecutil.exe, you must create an event subscription XML file and use the following command:
wecutil cs configurationFile.xml
The following XML is an example of the contents of a subscription configuration file that creates a source-initiated subscription to forward events from the Application event log of a remote computer to the ForwardedEvents log on the event collector computer.
When creating a source initiated subscription, if AllowedSourceDomainComputers, AllowedSourceNonDomainComputers/IssuerCAList, AllowedSubjectList, and DeniedSubjectList are all empty, then «O:NSG:NSD:(A;;GA;;;DC)(A;;GA;;;NS)» will be used as the default security descriptor for AllowedSourceDomainComputers. The default descriptor grants members of the Domain Computers domain group, as well as the local Network Service group (for the local forwarder), the ability to raise events for this subscription.
To validate that the subscription works correctly
On the event collector computer complete the following steps:
Run the following command from an elevated privilege command prompt on the Windows Server domain controller to get the runtime status of the subscription:
wecutil gr
Verify that the event source has connected. You might need to wait until the refresh interval specified in the policy is over after you create the subscription for the event source to be connected.
Run the following command to get the subscription information:
wecutil gs
Get the DeliveryMaxItems value from the subscription information.
On the event source computer, raise the events that match the query from the event subscription. The DeliveryMaxItems number of events must be raised for the events to be forwarded.
On the event collector computer, validate that the events have been forwarded to the ForwardedEvents log or to the log specified in the subscription.
Forwarding the security log
To be able to forward the Security log you need to add the NETWORK SERVICE account to the EventLog Readers group.
Setting up a source initiated subscription where the event sources are not in the same domain as the event collector computer
These instructions assume that you have administrator access to a Windows Server domain controller. In this case, since the remote event collector computer or computer(s) are not in the domain served by the domain controller, it is essential to start an individual client by setting Windows Remote Management to «automatic» using Services (services.msc). Alternatively, you can run «winrm quickconfig» on each remote client.
The following prerequisites must be met before the subscription is created.
On the event collector computer, run the following commands from an elevated privilege command prompt to configure Windows Remote Management and the Event Collector service:
winrm qc -q
wecutil qc /q
The collector computer should have a server authentication certificate (certificate with a server authentication purpose) in a local computer certificate store.
On the event source computer, run the following command to configure Windows Remote Management:
winrm qc -q
The source machine should have a client authentication certificate (certificate with a client authentication purpose) in a local computer certificate store .
Port 5986 is opened on the event collector computer. To open this port, run the command:
netsh firewall add portopening TCP 5986 «Winrm HTTPS Remote Management»
Certificates requirements
A server authentication certificate has to be installed on the Event Collector computer in the Personal store of the Local machine. The subject of this certificate has to match the FQDN of the collector.
A client authentication certificate has to be installed on the Event Source computers in the Personal store of the Local machine. The subject of this certificate has to match the FQDN of the computer.
If the client certificate has been issued by a different Certification Authority than the one of the Event Collector then those Root and Intermediate certificates needs to be installed on the Event Collector as well.
If the client certificate was issued by an Intermediate certification authority and the collector is running Windows 2012 or later you will have to configure the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel\ClientAuthTrustMode (DWORD) = 2
Verify that both the server and client are able to successfully check revocation status on all certificates. Use of the certutil command can assist in troubleshooting any errors.
Setup the listener on the Event collector
Set the certificate authentication with the following command:
winrm set winrm/config/service/auth @
A WinRM HTTPS listener with the server authentication certificate thumb print should exist on the event collector computer. This can be verified with the following command:
winrm e winrm/config/listener
If you do not see the HTTPS listener, or if the HTTPS listener’s thumb print is not same as the thumb print of the server authentication certificate on collector computer, then you can delete that listener and create a new one with the correct thumb print. To delete the https listener, use the following command:
winrm delete winrm/config/Listener?Address=*+Transport=HTTPS
To create a new listener, use the following command:
Configure certificate mapping on the Event Collector
Create new local user and add it to the local Administrators group.
Create the certificate mapping using a certificate that is present in the machine’s “Trusted Root Certification Authorities” or “Intermediate Certification Authorities”.
This is the certificate of the Root or Intermediate CA that issued the certificates installed on the Event Source computers (to avoid confusion, this is the CA immediately above the certificate in the certificate chain):
winrm create winrm/config/service/certmapping?Issuer= +Subject=*+URI=* @
From a client test the listener and the certificate mapping with the following command:
winrm g winrm/config -r:https:// :5986 -a:certificate -certificate:» «
This should return the WinRM configuration of the Event collector. Do not move past this step if the configuration is not displayed.
What happens at this step?
- The client connects to the Event Collector and sends the specified certificate
- The Event Collector looks for the issuing CA and checks if the is a matching certificate mapping
- The Event Collector validates the client certificate chain and revocations status
- If the above steps succeeds the authentication is completed.
You might get an Access denied error complaining about the authentication method, which could be misleading. To troubleshoot, check the CAPI log on the Event Collector.
- List the configured certmapping entries with the command: winrm enum winrm/config/service/certmapping
Event Source computer Configuration
Logon with an administrator account and open the Local Group Policy Editor (gpedit.msc)
Navigate to the Local Computer Policy\Computer Configuration\Administrative Templates\Windows Components\Event Forwarding.
Open “Configure the server address, refresh interval, and issuer certificate authority of a target Subscription Manager” policy.
Enable the policy and click the SubscriptionManagers “Show. ” button.
In the SubscriptionManagers window enter the following string:
Server=HTTPS:// :5986/wsman/SubscriptionManager/WEC,Refresh= ,IssuerCA=
Run the following command line to refresh Local Group Policy settings:Gpupdate /force
These steps should produce event 104 in your source computer Event Viewer Applications and Services Logs\Microsoft\Windows\Eventlog-ForwardingPlugin\Operational log with the following message:
«The forwarder has successfully connected to the subscription manager at address followed by event 100 with the message: «The subscription is created successfully.»
On the Event Collector, the Subscription Runtime Status will show now 1 Active computer.
Open the ForwardedEvents log on the Event Collector and check if you have the events forwarded from the Source computers.
Adam the Automator
How To Set Up Windows Event Log Forwarding In Windows Server 2016
Jeff Christman
Read more posts by this author.
Event log management is a critical skill to learn in all Windows environments. Activity is being recorded to Windows event logs every second and it acts as not only a security tool but also as a vital troubleshooting aid.
Once a server environment goes past a few servers though, managing individual server event logs becomes unwieldy at best. Luckily, you have a feature called Windows Event Forwarding (WEF) to make it easier.
Table of Contents
Windows Event Log Forwarding Overview
WEF is a service that allows you to forward events from multiple Windows servers and collect them in one spot. The service has two main components; a forwarder and a collector. A collector is a service running on Windows server that collects all events sent to it from an event log forwarder.
The “link” between the forwarding server and a collector is known as a subscription.
Collectors serve as subscription managers that accept events and allow you to specify which event log alerts to collect from endpoints.
WEF Project Overview
This is a Project article where we cover how to build a project or implement a solution. Each section hereafter will be cumulative steps that build upon the previous.
For this project, you’re going to learn how to set up a basic WEF implementation. You’ll learn how to set up both a collector and how to forward events to a collector with a subscription.
You’ll learn how to:
- Set up and configure an event log collector on a Windows Server instance. This will be the Windows Server that all of the event log forwarders will send events to.
- Create a GPO which, when applied, will point applicable Windows Server instances to the collector to send events to.
- Configuring the types of events to send to the collector.
You will learn how to work through each step in the remainder of this article.
Environment and Knowledge Requirements
Before you get too far, let’s first ensure my environment is the same as yours. Please be sure you have the following items in place before starting:
- (2) Windows Server instances – You can use any Window Server instance of 2012 R2 or higher. In this article, I’ll be using Windows Server 2016.
- Active Directory
- GPO – A familiarity with Group Policy Objects will be required.
- WinRM- WinRM needs to be running on all clients. Not configured just running.
Configuring the Event Log Collector
The first task to perform is configuring one of your Windows Server instances as the collector. Recall that the collector is the one that receives incoming event logs from the forwarder.
Enabling WinRM on the Collector
Windows Server instances that forward events to the collector do so over PowerShell Remoting or WinRM. You’ll first have to ensure WinRM is available on your collector. If the collector is running Windows Server 2012 R2 and above, WinRM is enabled by default, but the Windows Firewall may be interfering.
Run the the Enable-PSRemoting PowerShell cmdlet with no parameters on the collector. Even if PowerShell Remoting is already enabled, it will skip the necessary steps.
To be sure, you can also run Invoke-Command -ComputerName -ScriptBlock <1>from a remote computer. If you don’t receive an error, PowerShell Remoting is working.
Starting the Subscription Collector Service
Now that PowerShell Remoting is enabled and listening, start the subscription collector service. The subscription collector service needs to also start up automatically when Windows Server boots up.
On the collector, open Event Viewer click on Subscriptions. The first time you open the Subscriptions option, Windows will ask if you want to start the Windows Event Log Collector Service and configured to start automatically. Click Yes to accept.
You can see an example of the message below.
Congratulations! You now have a collector configured. It’s now time set up a GPO which will instruct Windows Server instances to forward events to the collector.
Setting up the Forwarders’ GPO
The next step is to configure one or more Windows servers to begin forwarding event logs to the collector. The easiest way to do so is by creating a GPO. This GPO can then be applied to one or more OUs which contain the servers to send events from.
You’ll learn the basics of setting up the necessary settings in a GPO in this Project article. But if you’d like to a complete rundown with all the available options, check out the Microsoft documentation.
Allowing the Network Service to Read Event Logs
WEF uses the Network Service account to read and send events from a forwarder to a collector. By default, the Network Service account does not have access to do this. You’ll first need to set this ACL to allow it.
Note: Many of the event logs in Windows Server already provide the Network Service account access to the common event logs like Application and System. But the account is not given access to the Security event log and other custom event logs.
To allow the Network Service account to read event logs on event log forwarders, use a GPO. In this article, you’ll learn how to allow the Network Service account access to the Security event log. Other event logs will follow the same process.
1. Begin by opening up a command prompt and running wevtutil gl security . This will provide various information about the Security event log. But the piece to pay attention to is the channelAccess SDDL.
You can see below an example of the SDDL you’ll need for the Security event log. The channelAccess line represents the permissions set on the event log. Copy the SDDL highlighted below and save it somewhere for later to add to a GPO.
2. Create a GPO via the Group Policy Management Console. Inside of the GPO, navigate to Computer Configuration → Policies → Administrative Templates → Windows Components → Event Forwarding → Configure target subscription manager.
3. Set the value for the target subscription manager to the WinRM endpoint on the collector. You will set the Server to be in the format:
Note the Refresh interval at the end of the collector endpoint. The Refresh interval indicates how often clients should check in to see if new subscriptions are available.
4. Next, find the SDDL you copied earlier from running wevtutil gl security and paste it into the setting Computer Configuration → Policies → Administrative Templates → Windows Components → Event Log Service → Security → Configure log access.
Note that this SDDL will take precedence over all other permissions that have been configured for the event log.
You can see an example of what your GPO will look like below for the Security event log.
5. Once the GPO is created, you’ll then either link this GPO to an existing OU containing the Windows servers to send event logs from or create a new OU and link the GPO. Any AD computer account you add to this OU will now set up a subscription to the collector.
Setting up a Subscription
While configuring WEF to collect all events for all Windows servers in an Active Directory domain may seem like a good idea, it’s not. You must be selective and only forward events that are important to you. Filtering out the noise from what matters is where WEF demonstrates its true value.
Let’s work through setting up a subscription for the Security Event log.
Since you’ve already created the GPO and linked it to an Active Directory OU containing the Windows servers you’d like to send events from, the event sources are already set up
- On the collector, open the Windows Event Viewer and right-click on Subscriptions, then create subscription.
2. As shown below, select the Source computer initiated option and then click Select Computer Groups. This is where you will select which computers you’d like to forward events from.
Pro Tip: Selecting AD Groups. Ex: “Domain Controllers” will auto-populate any computers within the group. No need to select individual computers every time you add a new server.
3. Next select the events to forward. Opening up the query filter as you can see below, select Security to forward events to the collector from the Security event log.
4. Once the Security log is selected, you can filter down even more by entering the event ID, keywords, users and computers as shown below.
5. Click OK to exit from the Query Filter.
6. Click Advanced in the Subscription Properties window. Now select Minimize Latency. This setting will ensure the collector will receive events as soon as possible and also to help it catch up if it gets behind.
Verifying the WEF Configuration
Once WEF is set up, you should now check to see if the forwarders actually checked in by checking the Source Computers column on the main Subscriptions page.
You can also check the Event Forwarding Plugin Operational log under Applications and Services on the client to make sure everything is working. This is where you’ll see descriptive errors if something has gone awry with Kerberos or firewalls.
All that is left to to is find a low-value client, clear the Security log and see if you get an alert.
Your Takeaways
In this Project, you learned how to set up a basic WEF subscription. You:
- Set up an event collector
- Created a GPO to create a subscription on various Windows Server forwarders
- Configured a WEF subscription to only send specific events
- Ensured the WEF subscription sent events as fast as possible
WEF is a bit tricky to configure initially, but once up and running, you should have little problems and minimal maintenance headaches.