Skip to content

Instantly share code, notes, and snippets.

@duffney
Last active June 27, 2016 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duffney/58ec33acf0e01dd67861c02d4b651821 to your computer and use it in GitHub Desktop.
Save duffney/58ec33acf0e01dd67861c02d4b651821 to your computer and use it in GitHub Desktop.
configuration Collector
{
Import-DscResource –ModuleName PSDesiredStateConfiguration
Import-DscResource -ModuleName xWindowsEventForwarding
Windowsfeature RSATADPowerShell{
Ensure = 'Present'
Name = 'RSAT-AD-PowerShell'
}
xWEFCollector Enabled {
Ensure = "Present"
Name = "Enabled"
}
xWEFSubscription ADSecurity
{
SubscriptionID = "ADSecurity"
Ensure = "Present"
LogFile = 'ForwardedEvents'
SubscriptionType = 'CollectorInitiated'
Address = (Get-ADGroupMember 'Domain Controllers' | % {Get-ADComputer -Identity $_.SID}).DNSHostName
DependsOn = "[xWEFCollector]Enabled","[WindowsFeature]RSATADPowerShell"
Query = @('Security:*')
}
}
Collector -OutputPath c:\DSC\
Start-DscConfiguration -Wait -Force -Path c:\DSC\ -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment