473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Accessing the registry...

34
Hi,
I am trying to write a small windows application that you enter a domain\username and a key and hit enter. When you do this, the program will retrieve the password (which was encrypted, but through the program it spits it out to the user unencrypted). This encrypted password is stored in the registry.

When I created it, I was an admin on the server where the registry was/is stored. But what I found out later, is that when regular non-admin users try to use the application, they get this exception:

System.ArgumentException ---> System.Security.SecurityException: Requested registry access is not allowed.

Here's a couple lines of the code where it chokes (chokes on second line)

Expand|Select|Wrap|Line Numbers
  1.                 // connect to remote LocalMachine RegistryHive
  2.                 RegistryKey remoteLocalMachineRegKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, repositoryServer);
  3.  
  4.                 // open remote respository registry key
  5.                 RegistryKey remoteRepositoryRegKey = remoteLocalMachineRegKey.OpenSubKey(regPath, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl);
  6.  
  7.  
I have tried every variation of Registry Rights and RegistryKeyPermissionCheck, but none of the combinations seem to work.

Can anyone help me out here and maybe point me to what I am doing wrong?

Thanks so much....
Nov 20 '07 #1
1 1380
Do the following changes on a remote computer from where you want to retrieve registry values

1. Start Registry Editor (Regedt32.exe) and go to the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l
2. On the Edit menu, click Add Key.
3. Enter the following values:
Key Name: SecurePipeServers
Class: REG_SZ
4. Go to the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\SecurePipeServers
5. On the Edit menu, click Add Key.
6. Enter the following values:
Key Name: winreg
Class: REG_SZ
7. Go to the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\SecurePipeServers\winreg
8. On the Edit menu, click Add Value.
9. Enter the following values:
Value Name: Description
Data Type: REG_SZ
String: Registry Server
10. Go to the following subkey.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\SecurePipeServers\winreg
11. Select "winreg". Click Security and then click Permissions. Add users or groups to which you want to grant access. and allow them full control

For your case Add SERVICE and NETWORK users on Remote PC and allow full control

12. Exit Registry Editor and restart Windows.
13. If you at a later stage want to change the list of users that can access the registry, repeat steps 10-12.

Hope this will solve your problem
Jul 20 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Daniel Pope | last post by:
Hello Everybody, I'm preparing for doing a daunting task: to access Out look Microsoft Outlook Express(regardles the operating system and Outlook version) from a Java applet (after the client...
6
by: Alex5222 | last post by:
I am making a program in C++ and was wondering how to make a program access and change the registry. Any help would be greatly appreciated. Thanks.
9
by: Swami | last post by:
I was wondering how I can programmatically find out the path of an installed program. I have an application that needs access to a config file that resides in the folder of another application. ...
4
by: Ashok | last post by:
Hello I need to programmatically change the permissions (ACL) on a specific registry key in a .NET app. Is there a way to do this in .NET? Thanks for the help, Ashok
2
by: Daniel Bass | last post by:
I've found this article on how to get ASP.Net to read/write from the server's registry, but it got heavily critted as being something that you should not do... ...
2
by: Mostafa Salama | last post by:
i have a problem in accessing registry from web service i made a web service that call a function to access registry The web service contain the following code Dim RegKey As...
3
by: mark.jerrom | last post by:
I'm fairly new to this Web Service game so please feel free to suggest something different if it looks like i'm completely off track! I'm trying to write an application that runs on a Pocket PC...
7
by: Cogito | last post by:
I installed Office 2000 Professional onto a Windows Vista laptop and when I tried to compile the code the following error message appears: 'User-Defined type not defined' I went to check the...
1
by: David Schrader | last post by:
Hello all, Let me start by saying that I'm not certain whether this belongs here, in this notes group, or another more developmentally oriented one. I'll try starting here then go elsewhere if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.