我有要求監視特定工作站的特定事件ID。 事件ID監視:監視特定事件ID爲特定的一組工作站Get-Eventlog - 監視特定事件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-事件日誌:網絡路徑沒有被發現。在行:6 char:15 + ... $ events = Get-EventLog - 計算機名$ Workstation -LogName「應用程序... + ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:NotSpecified:(:) [Get-事件日誌],IOException的 + FullyQualifiedErrorId信息:System.IO.IOException,Microsoft.PowerShell.Commands.GetEventLogCommand