O'Reilly logo

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition by Thomas Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

This recipe shows you how to forward events.

  1. Configure event collection on each server—first on DC1 (locally) then remotely to SRV1:
       wecutil qc /quiet | Out-Null       Invoke-Command -ComputerName SRV1 `                      -ScriptBlock {wecutil qc /quiet} | Out-Null
  1. Create the collector security group, add DC1:
      $ECGName='Event Collector Group'      New-ADGroup -Name $ECGName -GroupScope Global `                  -Path 'OU=IT,DC=Reskit,DC=Org'      Add-ADGroupMember -Identity $ECGName -Members'DC1$'
  1. Display membership of this new group:
      Get-ADGroupMember -Identity $ECGName
  1. Create a new GPO to configure event collection:
      $GPOName = 'Event Collection'      $ECGName = 'Event Collector Group'      $gpo  = New-GPO -Name $GPOName      $link = New-GPLink -Name $GPOName ` -Target "DC=Reskit,DC=Org" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required