• python wmi remote registry

    From Luis Gonzalez@21:1/5 to All on Tue Jul 18 01:25:01 2023
    I try to read a key in the registry of a remote machine.
    First, I tried with

    ---------------------------
    import winreg
    place = winreg.HKEY_LOCAL_MACHINE
    reg = winreg.ConnectRegistry(r'\\10.37.71.19', place) ---------------------------

    But it appears the error: "Path not found".

    Then I tried with:

    ---------------------------
    import wmi
    import _winreg
    c = wmi.WMI(namespace="default").StdRegProv
    result, value = c.GetStringValue (
    hDefKey=_winreg.HKEY_LOCAL_MACHINE,
    sSubKeyName="SYSTEM\ControlSet001\Services\MRxDAV",
    sValueName="ImagePath"
    )
    ---------------------------

    Other error: ModuleNotFoundError _winreg.

    I used winreg instead _winreg, but other error appears: "types do not match".


    ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
    How can I read the remote registry of a Machine in the same windows domain than mine ???????

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)