我有要求监视特定工作站的特定事件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