Category Archives: Configuration

Access to the registry key ‘Global’ is denied

If you use performance counters in web based apps you may end up running into this problem,

[UnauthorizedAccessException: Access to the registry key ‘Global’ is denied.]

UPDATE For IIS7 on windows server 2008 (see the end of this post)

The solution is pretty simple, originally posted here

How to Read Performance Counters Without Administrator Privileges [Ryan Byington]
If you have ever tried to read performance counter data on a Windows 2003 machine as a non admin user you will have likely seen an exception like the following:

System.UnauthorizedAccessException: 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)

Windows 2003, Windows XP x64 Edition, and Vista require that the user be part of the Performance Monitor Users group to read performance counter data. Simply adding your non admin user to this group will fix this problem.

Accessing counters remotely is another story though. On Windows 2003, Windows XP x64 Edition, and Vista you still must be part of the Performance Monitor Users group on the remote machine but there is a problem with the PerformanceCounter class where it tries to read some registry keys on the remote machine that a non admin users do not have access to. To give your user read access to these keys without having to be an admin on the remote machine complete the following steps on the remote machine:

Open the Registry Editor by going to the Start Menu and selecting Run…, then type “regedit”, and click the OK button.
Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg registry key.
Right click on the “winreg” key and select Permissions. Add users or groups to which you want to grant Read access.
Exit Registry Editor and restart Windows.
For more explanation on this process see here

UPDATE For IIS7 on windows server 2008 (16/11/2011)

This I can’t believe but none the less this is the way it is for IIS7. when you have performed the above steps and you are still receiving the error

Access to the registry key ‘Global’ is denied.

What you need to do is add the App Pool that your web app is running in to the “Performance Monitor Users” group as well. One immediate point is that you cannot find the group within the advanced search when adding objects to the group. You will have to manually type the name of the App Pool following this format

IIS APPPool\DefaultAppPool

Seems ridiculous I know and I haven’t fully got to the bottom of why but I suspect it is most likely something to do with the structure of IIS7 from an NT authentication perspective.

This also now puts an additional rule that one must not rename the App Pool and one must also be vigilant in as much as if you add another web app, creating a new app pool you might need to add this app pool to the group as well.

This updated solution came from here

Vista Boot – Element not Found

I recently had an enquiry from a user, they wanted to reclaim a partition on their machine that was allocated to emergency recovery. Seeing as the OS was different to that of the recovery I agreed.
My mistake was not to reconfigure the active primary partition. This caused the error msg Cannot find operating system.
So using the vista CD i booted in to restore mode and attempted to reconfigure the boot record, only to be presente with the message “element not found”. A quick google search yielded the solution. thanks goes to tturrisi for his accurate step by step recovery.

Excellent solution originally found here

Repair Vista Boot Loader
If dual booting Windows & Linux, and also use GRUB, if you remove the Linux partition(s) you probably can no longer boot Windows. While this is very easy to fix if the Windows operating system is XP or earlier, it is a bit more complicated (but still easy to do) in Windows Vista.

More often than not, when removing Linux partitions in a dual boot Vista-Linux environment, or when using GPARTED to resize partitions, Vista can no longer boot.

Windows Vista uses a different boot loader than earlier versions of Windows. Fortunately the Vista bootable DVD contains a utility for repairing the MBR and boot sections of the hard drive. To repair the Vista bootloader:

However, the utility mail fail on any action and give an error message of “Element not Found”. This is because resizing the Vista partition(s) or Linux partition(s) changes the disk’s file allocation table and the Vista partition may get marked as “inactive”. The same holds true when removing or resizing Linux partitions. A boot partition MUST be marked as “active” to be bootable.

The remedy for “Element not Found” is this:

1.Put the Windows Vista installation disc in the disc drive, and then start the computer.
2.Press a key when you are prompted.
3.Select a language, a time, a currency, a keyboard or an input method, and then click Next.
4.Click Repair your computer.
5.Click the operating system that you want to repair, and then click Next. (if no Vista operating system is listed, click Next anyway)
6.In the System Recovery Options dialog box, click Command Prompt.


At the command prompt, type diskpart.
This will get you to the DiskPart prompt, which allows you to use a variety of hard disk partitioning and formatting tools similar to FDISK in older versions of Windows.

At the DiskPart prompt, type select disk # where the # sign is the number of the hard disk drive with Vista installed on it. If your Vista drive is the only hard drive in your computer, it is Disk 0.

Select the partition by typing select partition # where the # sign is the partition that has Vista installed on it.

Type active and press ENTER. The Vista partition is now active. Finally, type ‘exit’ to close DiskPart. Reboot the computer using the Vista dvd and follow steps 1-6 above. You can now repair the Vista boot:

Fix the Master Boot Record: (commands)

bootrec /fixmbr
bootrec /rebuildbcd
bootrec /fixboot

Symantec Antivirus DWHxxxx.tmp Bogus Trojan Horse

Recently one of my users had thousdands and thousands of files in the quarantine
All of them aparently trojan horse risks
All the files began with DWH ending with .tmp
This is infact symantec live update wizard DWHWIZRD.EXE trying to download updates available for the symantec application group rather than obtain the latest virus update list.

In doing so the real time scanner Rtvscan.exe identifies the temp file as a trojan, so depending on the rules in the risk settings will depend on what should happen when risks are found, it either deletes the file or quarantines it, and low and behold the update wizard starts to download the file again.

To resolve the issue (this time), login as an administrator of sorts be it domain or local. Locate the symantec liveupdate folder typically %system%\progam files\symantec\liveupdate and run the LUALL.exe
This will kick off the live update manually, follow the wizard steps until its complete then reboot.

This will likely happen again in the future until symantec either come up with a solution in one of the updates.

Note: this only appears to happen to users that are not part of the “local admin” group of the pc in question.

bb handheld update error

If you have an enterprise activated device and you want to update the handheld software, you might bump into this little error

You cannot update your software using this system as your device is currently activated on BlackBerry Enterprise Server or BlackBerry Professional Software. Please contact your administrator for updates. Or check for updates from your carrier service provider

you have two choices
1. remove the it policy on the handheld
2. edit the it policy on the BES to allow non enterprise upgrade (this does lead to reactivation)

I opted for option 2 since i manage our BES server. those of you who opt for option 1 need to continue googling

So for option two.
1. we edit the policy on bes Refer to instructions
2. Roll the IT policy back out to the device from the bes manager
3. Reboot the device
4. download the latest handheld firmware to your pc one size fits all
5. install the latest firmware package on your pc
6. remove the vendor.xml (C:\Program Files\Common Files\Research In Motion\AppLoader)
7. run the loader.exe and upgrade the devices firmware (C:\Program Files\Common Files\Research In Motion\AppLoader)

updating firmware on bb device
updating firmware on bb device

8. reactivate the device to rejoin it to the bes

and your done

BES Pro Install

Im about to configure Blackberry Enterprise Server Professional edition (BESPro) in our work place.
We use MDA’s paired up with OWA to our exchange but several people have been complaining about their devices being very slow and combersome.
I decided to imlement BESPro and enable the devices for email and calendar sync, the mobile provider can provide the remaining services such as web browsing and BB messenger.

Anyway i was most of the way into the installation when i bumped into a problem with MSDE edition of the install. If you don’t have a default DB with MSDE installed, the BB installer doesnt prompt to create a DB, infact it doesnt do anything it fails to connect. So firstly you have to download MSDE from microsoft and go through the install sequence, at some point it will ask you if you would like to create a default db, select yes and complete the install.

Next up make sure that all the connection methods are enabled in the db for that default db, namely TCPIP and named pipes (use the SQL Server Configuration Manageer console to do this, dont forget to restart the instance of MSSQL in the services console).

Now in your bb installer you can give the default db instance name, if it asks you if you want to create a new DB “BESMgmt” say yes, once its created the new DB you must grant either the local admin group or the bb account relevant access permissions under the security node of the DB, otherwise when you come to activate your installation by filling in the license details it will fail to connect because the installer does not create the security permission. You will see this error in the log file [PIPTOOL]: Failed to update the license keys as no database connections.

Run 32 bit Apps in IIS on 64 bit OS

So you want to run your web Apps in 32 bit mode on your 64 bit windows operating system
Ive never needed to do this until now, Cybersouce, the online financial gateway we have recently integrated with dont support 64 bit when you use their .NET API.

OK all you need to do is
1. IIS management >> Local computer node >> Web Server Extensions >> set the “ASP.NET vr xxxx (32 bit)” to Allow
2. Run the following batch command (changing the folder targets if you need to)
cscript c:inetpubadminscriptsadsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_regiis.exe -i


If things go terribly wrong and you need to revert to 64bit then run the following batch
cscript c:inetpubadminscriptsadsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
C:WINDOWSMicrosoft.NETFramework64v2.0.50727aspnet_regiis.exe -i


WordPress add custom code highlighting tag button to visual toolbar

On my previous post to this i wanted to add some vb and tsql code, and have it appear like T-SQL or VB with similar syntax highlighting

So if you run wordpress here is how you do it
download the “WordPress:CodeHighlighingPlugin” from ideathinking

Follow their install instructions

And here is where my tip comes in

to add custom tag button so they appear in your Visual editing toolbar as your posting, locate the following js file

within the dev js file add the tag buttons of your choice, i personally added tsql and vb like so

Starting at line ~123
#Important note: replace the <_pre and <_/pre with the correct syntax (ie remove the _), i merely used it here in order the site would render the text rather than run through the highlighting engine

now you need to put it all on one line and copy paste into a similar location in the quicktags.js