You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Get-WinEvent命令时遭遇未授权操作错误的求助

Get-WinEvent命令时遭遇未授权操作错误的求助

各位好,我在使用Get-WinEvent命令的时候碰到了未授权操作的错误,明明已经用管理员权限打开PowerShell ISE了,可就是搞不明白问题出在哪,有没有大佬能帮我看看呀?

我用到的代码片段是这样的:

# Get the filtered events
$events = Get-WinEvent -LogName $logName -FilterXPath "*[System[EventID=$($eventIds -join ' or EventID=')]]"

弹出的错误信息如下:

Get-WinEvent : Attempted to perform an unauthorized operation.
At line:16 char:11

  • $events = Get-WinEvent -LogName $logName -FilterXPath "*[System[Event ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-WinEvent], UnauthorizedAccessException
    • FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWinEventCommand

另外还有脚本和错误提示的截图可以参考。

备注:内容来源于stack exchange,提问作者user3839914

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 08:03:15