解决EP拒绝访问注册表Global键的的问题

  问题描述

 

打开EP站点时出现如下Error:

Message: An unhandled error has occurred. To view details about this error, enable debugging in the web.config file or view the Windows event logs.

Source: mscorlib

Exception details:

Access to the registry key 'Global' is denied.

at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
at Microsoft.Win32.RegistryKey.GetValue(String name)
at System.Diagnostics.PerformanceMonitor.GetData(String item)
at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
at Microsoft.Dynamics.AX.ManagedInterop.RuntimeContext.InitializePerformanceCounters(String categoryName)
at Microsoft.Dynamics.Framework.BusinessConnector.PerformanceCounters..cctor()

本文地址:http://www.cnblogs.com/Interkey/p/Access-to-the-registry-key-Global-is-denied.html

  问题分析

从Exception Details 中可以得知 Exception 是在PerformanceCounters读取这个注册表key时没有相应权限而抛出的。

  解决思路

授予 PerformanceCounters 对应的服务相应的权限。

  解决方案

1、 因为我们这边没有权限来处理,而对方那边的操作是将安装部署的自定义用户 Service Account 加入到 Administrators用户组。

结果是:上述问题临时解决,但过段时间后依然出现上述问题。我方联系人因为以前有遇到过用户加入到Administrators用户组过段时间后用户又不在这个组的情况据此猜测对方也是遇到了这种情况,但具体情况未知。

2、 经过搜索找到了同样问题的解决方案[Message: Access to the registry key 'Global' is denied],不过是英文的,在实际操作中一时还不好理解上述的描述。故此翻译成中文并加以解释:

a)      打开Computer Management - System Tools - Local Users and Groups - Groups - Performance Log Users.

b)      添加 Identity 到Performance Log Users 组。难点在于得到正确的Identity。检查应用程序池的 Identity。如果使用的是ApplicationPoolIdentity,请继续下面的步骤。

c)      无需添加一个本地用户。因为ApplicationPoolIdentity 并不是一个实际存在的用户,所以要添加到Performance Log Users 组需要使用如下形式:IIS AppPool\AppPoolName (其中AppPoolName 是应用程序池名,例如:IIS AppPool\AX2012)。

d)      为了使更改生效,需要重启IIS或者停止再启动相应用应用程序池。回收相应应用程序池不会使更改生效。

步骤b使用的是ApplicationPoolIdentity,如果使用本地用户,则直接将此用户添加到Performance Log Users 组,但因为没有相应的权限,所以无法进行测试。

至于将用户添加到Administrators用户组过段时间后失效,暂时无法跟进。

本文地址:http://www.cnblogs.com/Interkey/p/Access-to-the-registry-key-Global-is-denied.html

Here is a link for more information about Application Pool Identities.

  总结

问题的本质是赋予权限以让PerformanceCounters有读取相应注册表的权限。但方案1是直接将权限添加到管理员组,方案2是将相应的用户添加到Performance Log Users 组,因为此用户是虚拟用户,所以要按一定的格式添加。本质上还是授权。 


  其他

来这里以后感觉快要变成了技术支持了,工作内容与预期偏差甚远,所用技术为AX 2012 和 SharePoint 2010,而且主要工作内容为解决技术问题而非开发,.NET编程几乎没有,由于对业务还不熟悉,所以X++的编写也没有。感觉有些偏离方向了(拿手的可是C#,现阶段以开发为主),当然好处也有:规范化和时间自由。不过既然来了,肯定要把它做好!

本文地址:http://www.cnblogs.com/Interkey/p/Access-to-the-registry-key-Global-is-denied.html

posted on 2015-04-01 17:35  Cosmic_Spy  阅读(1503)  评论(1编辑  收藏  举报

导航

Your IP: