Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. read registry key(s) on remote computer

read registry key(s) on remote computer

Scheduled Pinned Locked Moved Windows API
csharpwindows-adminhelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 1540387
    wrote on last edited by
    #1

    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.

    S 1 Reply Last reply
    0
    • U User 1540387

      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.

      S Offline
      S Offline
      Scott Dorman
      wrote on last edited by
      #2

      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]

      U 1 Reply Last reply
      0
      • S Scott Dorman

        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]

        U Offline
        U Offline
        User 1540387
        wrote on last edited by
        #3

        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.

        S D 2 Replies Last reply
        0
        • U User 1540387

          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.

          S Offline
          S Offline
          Scott Dorman
          wrote on last edited by
          #4

          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]

          1 Reply Last reply
          0
          • U User 1540387

            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.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups