看起来下面的代码不起作用
$EventLogonIDs="4611","4624","4625","4634","4647","4648","4672","4774","4775","4 908","4964"
$MultipleIDLogEntries={Get-WinEvent -FilterHashtable @{Logname='security';Id=@($using:EventLogonIDs)}}
Get-PSSession | % {icm -Session $_ -Command $MultipleIDLogEntries}
它为每个服务器返回以下内容
未找到符合指定选择条件的事件。+ CategoryInfo : ObjectNotFound: (:) [Get-WinEvent],异常 + FullyQualifiedErrorId : NoMatchingEventsFound,Microsoft.PowerShell.Commands.GetWinEventCommand + PSComputerName : testitservice.cloudapp.net
但是如果 $EventLogonIDs="4624",它就可以正常工作。
出了什么问题?谢谢!