Curated Examples
Enable remote event log firewall rules
Use PSWinReporting setup guidance to enable Remote Event Log Management on domain controllers.
This pattern is useful when a reporting host needs remote access to event logs on domain controllers.
It is adapted from Examples/RunMe-FixFirewallIssues.ps1.
Example
Import-Module ActiveDirectory
$domainControllers = Get-ADDomainController -Filter *
Invoke-Command -ComputerName $domainControllers.HostName {
Set-NetFirewallRule -DisplayGroup 'Remote Event Log Management' -Enabled True -PassThru |
Select-Object DisplayName, Enabled
}
What this demonstrates
- selecting domain controllers from Active Directory
- enabling the Windows Firewall rule group required for remote event log access
- returning the changed rule state for review