471,086 Members | 1,186 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,086 software developers and data experts.

Remote Registry - Requested registry access is not allowed.

JB
I am trying to access a registry key on computer like so:

key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
computerName).OpenSubKey(Subkey);

There are two keys I am trying to read, 1 works, and the other gives
me the "Requested registry access is not allowed."
i've narrowed it down to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office
It doesnt let me access that path, but the permissions are the same.
I can access it alright on my own machine (passing my machine name
into OpenRemoteBaseKey) but not anyone's remote machine.

It lets me access HKLM\Software\Microsoft\Windows NT
but not
HKLM\Software\Microsoft\Office

Although I get the same error "Requested registry access is not
allowed" if i enter an incorrect path, eg HKLM\Software\fdjkhfjkh

Any ideas where i may be going wrong?

Jun 26 '07 #1
3 8159
this could a CAS (code access security) issue....but not sure

"JB" <ja*******@gmail.comwrote in message
news:11*********************@w5g2000hsg.googlegrou ps.com...
>I am trying to access a registry key on computer like so:

key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
computerName).OpenSubKey(Subkey);

There are two keys I am trying to read, 1 works, and the other gives
me the "Requested registry access is not allowed."
i've narrowed it down to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office
It doesnt let me access that path, but the permissions are the same.
I can access it alright on my own machine (passing my machine name
into OpenRemoteBaseKey) but not anyone's remote machine.

It lets me access HKLM\Software\Microsoft\Windows NT
but not
HKLM\Software\Microsoft\Office

Although I get the same error "Requested registry access is not
allowed" if i enter an incorrect path, eg HKLM\Software\fdjkhfjkh

Any ideas where i may be going wrong?

Jun 26 '07 #2
You would need the right permissions for accessing the registry on the
remote PC.
Please verify (Registry Editor>Edit>Permissions)

Hope this helps!
Thanks -

"JB" <ja*******@gmail.comwrote in message
news:11*********************@w5g2000hsg.googlegrou ps.com...
>I am trying to access a registry key on computer like so:

key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
computerName).OpenSubKey(Subkey);

There are two keys I am trying to read, 1 works, and the other gives
me the "Requested registry access is not allowed."
i've narrowed it down to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office
It doesnt let me access that path, but the permissions are the same.
I can access it alright on my own machine (passing my machine name
into OpenRemoteBaseKey) but not anyone's remote machine.

It lets me access HKLM\Software\Microsoft\Windows NT
but not
HKLM\Software\Microsoft\Office

Although I get the same error "Requested registry access is not
allowed" if i enter an incorrect path, eg HKLM\Software\fdjkhfjkh

Any ideas where i may be going wrong?

Jun 26 '07 #3
JB
Cheers, that does seem to be why it is encountering problems.
I can run the app fine as 'Administrator', but, the permissions are
set so all users should have read access.

I want a few key users to be able to run the app, how would i go about
authenticating on a remote machine and not using my current login as
authentication?

Or related: Is there a way of reading the registry through WMI? I'm
already connecting to each machine through wmi as admin, if i could
read the registry somehow through there it would make it much easier.
I couldn't find a method of doing it though.

On 26 Jun, 11:54, "Shine Xavier" <shine.xav...@gmail.comwrote:
You would need the right permissions for accessing the registry on the
remote PC.
Please verify (Registry Editor>Edit>Permissions)

Hope this helps!
Thanks -
Jun 26 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Yoshitha | last post: by
1 post views Thread by Patrick.O.Ige | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.