0
这项工作对我来说:获取-WinEvent -FilterHashTable包含多个ID的一个变量不工作
Get-WinEvent -FilterHashTable @{Logname = "ForwardedEvents" ; ID = 4625,4740}
(....结果我想到...)
这工作:
$EventId = "4625"
Get-WinEvent -FilterHashTable @{Logname = "ForwardedEvents" ; ID = $EventId}
这不起作用:
$EventId = "4625,4740"
Get-WinEvent -FilterHashTable @{Logname = "ForwardedEvents" ; ID = $EventId}
尔ror ...
Get-WinEvent : No events were found that match the specified selection criteria.
At line:1 char:13
+ Get-WinEvent <<<< -FilterHashTable @{Logname = "ForwardedEvents" ; ID = $EventIds}
+ CategoryInfo : ObjectNotFound: (:) [Get-WinEvent], Exception
+ FullyQualifiedErrorId : NoMatchingEventsFound,Microsoft.PowerShell.Commands.GetWinEventCommand
任何人都可以帮忙吗?
谢谢马特。很棒。 – adriansroaming