Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

Remote Registry - Requested registry access is not allowed.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JB - 26 Jun 2007 11:27 GMT
I am trying to access a registry key on computer like so:

key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,
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?
Rotsey - 26 Jun 2007 11:32 GMT
this could a CAS (code access security) issue....but not sure

>I am trying to access a registry key on computer like so:
>
[quoted text clipped - 17 lines]
>
> Any ideas where i may be going wrong?
Shine Xavier - 26 Jun 2007 11:54 GMT
You would need the right permissions for accessing the registry on the
remote PC.
Please verify (Registry Editor>Edit>Permissions)

Hope this helps!
Thanks -

>I am trying to access a registry key on computer like so:
>
[quoted text clipped - 17 lines]
>
> Any ideas where i may be going wrong?
JB - 26 Jun 2007 12:28 GMT
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.

> You would need the right permissions for accessing the registry on the
> remote PC.
> Please verify (Registry Editor>Edit>Permissions)
>
> Hope this helps!
> Thanks -
Shine Xavier - 26 Jun 2007 12:59 GMT
Yes, you can do this by the folllowing 3 steps:

Step 1:
Create a domain user (say application user)

Step2:
Assign Registry "Read Access" on the remote pc/server for just the "required
key" (Right click on the respective key and assign permissions) for "this
user".
This will tighten the security.

Step3:
Now run the application using the identity of the application user created
in Step 1.
You could spawn a separate process and run the application that accesses the
remote registry using this user role.

-------
Now as for using WMI, please check out this link -
http://msdn2.microsoft.com/en-us/library/aa394600.aspx

Hope this helps!
Thanks -

> Cheers, that does seem to be why it is encountering problems.
> I can run the app fine as 'Administrator', but, the permissions are
[quoted text clipped - 15 lines]
>> Hope this helps!
>> Thanks -
JB - 26 Jun 2007 14:47 GMT
Cheers for the help.
I was with you all the way upto step 3.
How do i run the application 'as the user created in step 1'? Run-as..
in XP doesnt work, i'd rather not have to log out and log in as the
user (which works) because thats quite a hassle.
Ideally i'd like to just give the application administrator
priveledges, it has to read a few registry keys on ~100 PC's on the
network, unless i can assign permissions using Group Policy.

> Yes, you can do this by the folllowing 3 steps:
>
[quoted text clipped - 38 lines]
> >> Hope this helps!
> >> Thanks -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.