我需要监视特定工作站集的特定事件 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 : 未找到网络路径。在 line:6 char:15 + ... $events = Get-EventLog -ComputerName $Workstation -LogName "Applica ... + ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-EventLog], IOException + FullyQualifiedErrorId:System.IO.IOException,Microsoft.PowerShell.Commands.GetEventLogCommand