473,836 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing the registry...

34 New Member
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.Argument Exception ---> System.Security .SecurityExcept ion: 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);
  4.                 // open remote respository registry key
  5.                 RegistryKey remoteRepositoryRegKey = remoteLocalMachineRegKey.OpenSubKey(regPath, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl);
I have tried every variation of Registry Rights and RegistryKeyPerm issionCheck, 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 1413
1 New Member
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_MACH INE\SYSTEM\Curr entControlSet\C ontrol
2. On the Edit menu, click Add Key.
3. Enter the following values:
Key Name: SecurePipeServe rs
Class: REG_SZ
4. Go to the following subkey:
HKEY_LOCAL_MACH INE\SYSTEM\Curr entControlSet\C ontrol\SecurePi peServers
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_MACH INE\SYSTEM\Curr entControlSet\C ontrol\SecurePi peServers\winre g
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_MACH INE\SYSTEM\Curr entControlSet\C ontrol\SecurePi peServers\winre g
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

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 (user) acknowleges to run this applet on his machine). The user has to read the existent user Microsoft Outlook users accounts and to setup another Microsoft Outlook user accont. As I know so far, that the only way is to access from the applet a...
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.
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. I'm guessing that this can be done by accessing the registry, but some articles or sample code would be useful. Thanks.
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
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... http://www.wwwcoder.com/main/parentid/263/site/2281/68/default.aspx what's the problem with a server side application reading data from a server
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 Microsoft.Win32.RegistryKey RegKey = Microsoft.Win32.Registry.LocalMachine RegKey = RegKey.OpenSubKey(KeyPath, True) but it gives me an error, unauthorized access of registry thanks
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 that is accessing data stored in a SQL server database on a seperate server (not on the pocket pc). This wil be deployed to lots of customers sites so I can't hard-code the location of the database in the program. I wrote a seperate little app...
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 registry and the following message appears: 'Error accessing the system registry'. I have tied to repair Access using the Office 2000 repair facility but no luck.
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 you decide otherwise. (Already forwarded here, sort-of, from: microsoft.public.windowsnt.registry.) I'm writing a Visual Basic program which stores and retrieves data in the registry - no big thing, I've got all that code written
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.