我可以在我的服务器上以管理员身份获得性能计数器:
PS C:\Users\Administrator\Documents> Get-Counter '\memory\available bytes'
Timestamp CounterSamples
--------- --------------
28.04.2014 5:19:55 \\vm108838-2\memory\available bytes :
393011200
但是当我尝试从非管理员用户获得性能计数器时,我收到以下错误:
PS C:\Users\lpu3\Documents> Get-Counter '\memory\available bytes'
Get-Counter : Unable to connect to the specified computer or the computer is offline.
+ CategoryInfo : InvalidResult: (:) [Get-Counter], Exception
+ FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.GetCounterCommand
性能计数器通常受访问控制列表(ACL)的保护。要获取所有可用的性能计数器,请使用“以管理员身份运行”选项打开Windows PowerShell。
所以,问题是,我可以在哪里更改ACL以包含我的用户?
答案 0 :(得分:1)
请勿更改ACL。将用户帐户添加到a group that has permissions以使用性能监视器日志。根据文件:
Members of the Performance Monitor Users group
• Can use all the features that are available to the Users group.
• Can view real-time performance data in Performance Monitor, and can change the Performance Monitor display properties while viewing real-time data.
• Cannot create or modify Data Collector Sets.
Members of the Performance Log Users group
• Can use all the features that are available to the Performance Monitor Users group.
• Can create and modify Data Collector Sets after the group is assigned the Log on as a batch user user right, as described in Enable Logging for Performance Log Users Group Members.
• Cannot use the Windows Kernel Trace provider in Data Collector Sets.