read registry key(s) on remote computer
-
Hi. I'm trying to read some registry keys on some remote computers, but I get an "Attempted to perform an unauthorized operation....." can anyone please help me, with some hints on how I can read remote registry keys in C# windows development? you can either post in here or send the answer to jan@k64.dk \Jan.
-
Hi. I'm trying to read some registry keys on some remote computers, but I get an "Attempted to perform an unauthorized operation....." can anyone please help me, with some hints on how I can read remote registry keys in C# windows development? you can either post in here or send the answer to jan@k64.dk \Jan.
What is the code you are trying to use? This is possible, but you must have remote registry permissions on the remote computer.
Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[Forum Guidelines] [Articles] [Blog]
-
What is the code you are trying to use? This is possible, but you must have remote registry permissions on the remote computer.
Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[Forum Guidelines] [Articles] [Blog]
Hi. I'm using RegistryKey memory = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, line.ToString()); memory = memory.OpenSubKey("HARDWARE\\RESOURCEMAP\\System Resources\\Physical Memory\\Translated"); And it works fine. But is it possible to set username/password in the code so that the user I'm using to run the application with (the account I'm logging on to my computer with), dosn't have to be a member on the remote machine? \Jan.
-
Hi. I'm using RegistryKey memory = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, line.ToString()); memory = memory.OpenSubKey("HARDWARE\\RESOURCEMAP\\System Resources\\Physical Memory\\Translated"); And it works fine. But is it possible to set username/password in the code so that the user I'm using to run the application with (the account I'm logging on to my computer with), dosn't have to be a member on the remote machine? \Jan.
Member 1541838 wrote:
is it possible to set username/password in the code so that the user I'm using to run the application with (the account I'm logging on to my computer with), dosn't have to be a member on the remote machine?
No, it will always run with the current credentials so the user will need to be a member on the remote machine or part of a global admin group. That being said, you could possibly do this using impersonation. You would impersonate the user that has rights, run your code and then undo the impersonation.
Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[Forum Guidelines] [Articles] [Blog]
-
Hi. I'm using RegistryKey memory = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, line.ToString()); memory = memory.OpenSubKey("HARDWARE\\RESOURCEMAP\\System Resources\\Physical Memory\\Translated"); And it works fine. But is it possible to set username/password in the code so that the user I'm using to run the application with (the account I'm logging on to my computer with), dosn't have to be a member on the remote machine? \Jan.
You're using the hard method of getting the machines RAM size. You can do the same thing with WMI and the Win32_ComputerSystem and/or Win32_PhysicalMemory classes to get the total RAM size, without doing all the nasty calculations to computer it from the registry. Of course, you're still going to need an account that has permissions on the remote machines.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008