Read one registry key value on the remote machine

It is very difficult for me to achieve this seemingly very simple goal ...

I need to collect the value of a single registry key on multiple machines to check if I need to validate machine scans with newer versions of software. I am allowed to use python 3 according to our company policy (which is on drugs, but what can I do).

I have been looking into using the winreg module to connect to a remote machine (using credentials, we are on a domain), but I run into over and over again

TypeError: the object is not a PyHKEY object (or a number of other issues.)

this seems like a very common need and I was surprised that I had some python 3 examples that I can use to figure out what I am doing wrong.

Any help that anyone would be kind enough to provide would be greatly appreciated. Thanks in advance.

+2


source to share


1 answer


Can you show the code you are writing? Did you open the key? A lot of people have problems because they didn't open it? This is just a guess, hope it works.



key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r'SYSTEM\CurrentControlSet\Enum\Root')

      

+1


source







All Articles