Como ativar logs de eventos usando Windows PowerShell :
To enable it we create a new EventLogConfiguration object and pass it the name of the log we want to configure. We enable it and save the changes.
Exemplo modificado deste artigo:
$logName = 'Microsoft-Windows-CAPI2/Operational'
$log = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $logName
$log.IsEnabled = $true
$log.SaveChanges()
Usando o cmdlet nativo do PowerShell:
$EventLog = Get-WinEvent -ListLog 'Microsoft-Windows-CAPI2/Operational'
$EventLog.IsEnabled = $true
$EventLog.SaveChanges()