【发布时间】:2017-07-28 18:32:46
【问题描述】:
我需要监控特定工作站集的特定事件 ID。 事件 ID 监视器:监视特定工作站集的特定事件 ID
$Workstations = gc c:\NotBackedUp\Workstation.txt
foreach ($Workstation in $Workstations)
{
$events = Get-EventLog -ComputerName $Workstation -LogName "Application" | Where-Object {$_.EventID -eq "2"} | Format-List
}
$events >> C:\NotBackedUp\Test.txt
但我会得到如下错误,
Get-EventLog : 未找到网络路径。在行:6 字符:15 + ... $events = Get-EventLog -ComputerName $Workstation -LogName "Applica ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-EventLog], IOException + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.GetEventLogCommand
【问题讨论】:
标签: get-eventlog event-id