logging - methods to collect windows event logs remotely? -
is there method faster wmi available collect windows event logs remotely using powershell? if not,how can make efficient multi-threading wmi-query collecting logs multiple hosts?
look into
get-eventlog
you can launch in job multithread it:
start-job -argumentlist $hostname { return $(get-eventlog -computername "$($args[0])" -logname application -source "source name") }
then collect data:
$logs = $(get-job | wait-job | receive-job)
which this:
foreach($hostname in $hosts) { start-job -argumentlist $hostname { return $(get-eventlog -computername "$($args[0])" -logname application -source "source name") } } $logs = $(get-job | wait-job | receive-job)
Comments
Post a Comment