It is easy to connect to a remote Windows machine and retrieve information from the registry using the Python Windows registry access module _winreg
from _winreg import *
reg = ConnectRegistry('computer123222', HKEY_LOCAL_MACHINE)
key = OpenKey(reg, 'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate',0,KEY_READ)
value = QueryValueEx(key, 'SusClientId')
ConnectRegistry() allows you to specify the remote computer and one of the HKEY constants like HKEY_LOCAL_MACHINE or HKEY_USERS.
OpenKey() specifies the remote registry as the location of the hive), the sub key, an integer of 0 (it must be 0!) followed by the registry key access rights.
coding, microsoft, open source, sysadmin, windows. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.