为什么使用Powershell get-winevent获取未经授权的错误?

我是一个域pipe理员等效,我已经尝试在提升的控制台中运行(右键单击>以pipe理员身份运行),我一直执行时出现错误

get-winevent -logname application | where {$_.message -match "Faulting application"} | ` select TimeCreated,message 

那么,我会得到三行结果

 Get-WinEvent : Attempted to perform an unauthorized operation. At line:1 char:13 Get-WinEvent : Attempted to perform an unauthorized operation. + CategoryInfo : NotSpecified: (:) [Get-WinEvent], UnauthorizedAccessException + FullyQualifiedErrorId : Attempted to perform an unauthorized operation.,Microsoft.PowerShell.Commands.GetWinEventCommand 

这似乎是一个新的发展,从来没有得到过这些错误。

这是一致的 – 如果我用另一台服务器的-computername运行它,模式仍然是3 OK行,然后X错误,然后5 OK行等

其他事件日志会发生吗? 例如,如果运行以下命令来查看具有特定事件ID的login事件?

 Get-WinEvent -FilterHashtable @{logname='security'; id=@(4624,4634,4672,4648)} 

如果这样的话,应用程序事件日志中可能有一些您无权访问的项目。 在这种情况下,您将不得不使用诸如Process Monitor之类的东西来找出访问被拒绝的原因。

使用FilterHashtable参数将过滤条件传递给Get-WinEvent cmdlet可能会获得更好的结果。 有关示例,请参见http://ss64.com/ps/get-winevent.html

我可以在一个locking的系统上使用非pipe理员用户来运行。 检查GPO中的事件日志的权限和审核策略。 您可能只有审核员才能看到日志。 祝好运故障排除,如果是这样的话。