I noticed this Error in a few blogs and thought I would have a crack at it and I was able to recreate it in my lab.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[UnauthorizedAccessException: Access to the registry key 'Global' is denied.]
Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) +2116595
Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity) +2779509
Microsoft.Win32.RegistryKey.GetValue(String name) +29
System.Diagnostics.PerformanceMonitor.GetData(String item) +96
System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item) +147
System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category) +65
System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName) +125
System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName) +9
Microsoft.EnterpriseManagement.OperationsManager.DataAbstractionLayer.Counters.BuildPerformanceCounter(DalCounter counterName, String instanceName) +302
Microsoft.EnterpriseManagement.OperationsManager.DataAbstractionLayer.DataAbstractionFactory..cctor() +20[TypeInitializationException: The type initializer for 'Microsoft.EnterpriseManagement.OperationsManager.DataAbstractionLayer.DataAbstractionFactory' threw an exception.]
Microsoft.EnterpriseManagement.OperationsManager.DataAbstractionLayer.DataAbstractionFactory.GetInstance(IDataAbstractionBuilder builder) +0
login.Page_Unload(Object sender, EventArgs e) +22
You will also get this error in the Event log on the Web Console server (Click to view full size):
This is what I did to create the Issue and further down is the workaround which is a common fix for this issue in some other Blogs and also with other errors Microsoft have in their Knowledge Base that arn’t specific to SCOM.
To set the scene this is what I set out to achive. I wanted to create a New Monitoring Diagram View to display a couple of intranet sites that I want to monitor from all our national offices and unlike the Web Application State view I only wanted to see the Websites status ie: Health or Critical etc.
I order to do this I would have to do the following, create new Groups, new Monitor, new Management Pack, new View and to then restrict access to only show the one new View in the Web Console for a few people.
1. Created the Management Pack
2. Created the Web Application monitor for the sites
3. Created a Group and then added 2 other Groups as Child Groups. (One for each Application and added the appropriate Web Application to each group)
4. Created the new Monitor to report the status of the 2 Child Groups
5. Created the Custom Diagram View showing the Primary Group and the 2 Child Group.
6. Under Adminitriation I created a new Read-Only Operator, New user Role.
7. Added the Domain Users (Same Domain as SCOM is in) that would have access to this group and also specified that all they could see was the 3 new groups I had created and the new view as well as the Web Applications State view. (Now this is where I think I need to look further to see whats happening.)
8. I then accessed the Web Console and got the above error.
9. Applied the resolution: Added all the users from the new ‘User Role’ to the local Performance Monitor Users group on the server that runs the Web Console. (I however didnt add them to the local Users group as this is inherited by the Domain Users group. If this isn’t the case for you then you should make sure those users are also added to this group)
10. Closed all IE browser and Performed an IISReset (run from cmd)
11. Logged back on and EVERYTHING was working great. Here is what I saw for reference.