๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.win32.programmer.wmi
Article #1

python wmi remote registry

#1
From: Luis Gonzalez
Date: Tue, 18 Jul 2023 08:25
35 lines
2447 bytes
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 ???????
Technical Details
Message-ID: <d3a0da85-820b-4237-9aa0-b238ff6fc9b4n@googlegroups.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!nnrp.usenet.blueworldhosting.com!!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <d3a0da85-820b-4237-9aa0-b238ff6fc9b4n@googlegroups.com>
Subject: python wmi remote registry
Date: Tue, 18 Jul 2023 08:25:01 +0000
From: Luis Gonzalez <kewapo@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!nnrp.usenet.blueworldhosting.com!!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
X-Received: by 2002:a05:6214:14a9:b0:634:9899:fab with SMTP id bo9-20020a05621414a900b0063498990fabmr5123qvb.3.1689668702158;
X-Received: by 2002:a05:6808:1b0c:b0:3a3:c492:9be6 with SMTP id
 bx12-20020a0568081b0c00b003a3c4929be6mr18019881oib.2.1689668701853; Tue, 18
Newsgroups: microsoft.public.win32.programmer.wmi
Injection-Info: google-groups.googlegroups.com; posting-host=185.179.105.105; posting-account=ynvTCgoAAAAjIzMqd0Tz5QnjSZqZpszg
NNTP-Posting-Host: 185.179.105.105
User-Agent: G2/1.0
MIME-Version: 1.0
Injection-Date: Tue, 18 Jul 2023 08:25:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2099