“访问注册表项'全局'被拒绝”访问性能计数器时 [英] "Access to the registry key 'Global' is denied" when accessing performance counters

查看:246
本文介绍了“访问注册表项'全局'被拒绝”访问性能计数器时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从ASP.NET应用程序中读取一些性能计数器。当我这样做时,我收到错误访问注册表项'全局'被拒绝。



我试过按照说明有答案。您必须使用应用池的名称。就我而言,应用程序池的名称是暂存,因此正确的用户是 IIS APPPOOL \staging 。将此用户置于性能监视器用户组中可以解决我的问题。


I'm attempting to read some performance counters from my ASP.NET application. When I do, I get the error "Access to the registry key 'Global' is denied."

I have tried following the instructions here and here, using the user IIS AppPool\DefaultAppPool, which is the identity my app pool is configured to use:

I have added that user to the Performance Monitor Users group:

And after adding the user, I restarted my computer. But I am still getting the error.

I have also tried adding the users IUSR and NETWORK SERVICE to the Performance Monitor Users group, but those don't work either. Out of desperation, I tried adding the user "Everyone" to the Performance Monitor Users group, and that actually does work. But my goal is to log statistics from my application in production, and I don't want to add "Everyone" to that group on the production server.

What else needs to happen in order to read the performance counters without generating a security exception?

解决方案

I found the solution. Whereas various links around the Internet tell you to use the identity IIS APPPOOL\DefaultAppPool, that is NOT the full story. That will only work if you are in fact assigning your applications to an app pool named "DefaultAppPool".

This link at ServerFault has the answer. You must use the name of your app pool. In my case, the app pool's name was "staging", so the correct user was IIS APPPOOL\staging. Putting this user in the Performance Monitor Users group fixed my issue.

这篇关于“访问注册表项'全局'被拒绝”访问性能计数器时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆