Questions tagged [wmi]

Windows Management Instrumentation (WMI) is an API for managing the Windows operating system on local or remote computers.

4365 questions
1
vote
2 answers

Pulling back remote netstat data with WMI

I am trying to get netstat information from a remote computer. Right now, my method is: 1) Execute a RemoteProcess in C# with the command netstat -a > C:\file.out 2) I map the remote C$ share to my local 3) I read the file from the mount I'm looking…
coergo
  • 315
  • 2
  • 7
  • 18
1
vote
1 answer

Wmi object conversion to json using python

import wmi import win32com.client def Usb_detect(): raw_wql = "SELECT * FROM __InstanceCreationEvent WITHIN 2 WHERE TargetInstance ISA \'Win32_USBHub\'" c = wmi.WMI () watcher = c.watch_for(raw_wql=raw_wql) # while 1: usb = watcher() #
1
vote
1 answer

How Get All Camera Devices ID From PowerShell

I am trying to get all camera devices ID and respective names using PowerShell command line. I tried several commands, but nothing has done what I am aiming. Below my "best" approach: Get-CimInstance Win32_PnPEntity | where caption -match…
1
vote
0 answers

Windows IoT, get the number of processor's cores allocated for Soft Real Time

From the Microsoft documentation soft-real-time-device, we allocate the number of processor's cores to be allocated for Soft Real Time using the following PowerShell…
Phiber
  • 1,041
  • 5
  • 17
  • 40
1
vote
1 answer

how to get windows device information in flutter using win32 api and wmi?

I am trying to get windows machine information such as bios vendor, serial and other cpu info like cores, vendor, socket etc...(some static info). I believe that I can achieve this using ffi and win32 api, but I don't have basic idea to start. In…
Abdul azeez VP
  • 156
  • 1
  • 1
  • 9
1
vote
1 answer

Problem retrieving Hostaddress from Win32_TCPIPPrinterPort

I'm running into an odd issue retrieving printer port addresses. When I get all the entries in Win32_TCPIPPrinterPort, the HostAddress field (which should have the IP address) is usually blank/null, only the port name has a value. To make it a bit…
Anthony
  • 720
  • 4
  • 10
1
vote
1 answer

IIS6 Classic ASP WMI Permissions

I'm developing a simple internal Classic ASP website (served by IIS6) to help reboot a handful of remote computers. The App Pool is running under a set of credentials that is an admin on this group of computers, but whenever attempting to connect to…
klyd
  • 3,939
  • 3
  • 24
  • 34
1
vote
0 answers

In PowerShell how to execute asynchronous WMI query using callbacks?

In VBScript, WMI can execute asynchronous queries by using ExecQueryAsync and WbemScripting.SWbemSink, for example: Sub Main() Set sink = WScript.CreateObject("wbemscripting.swbemsink","sink_") Set wmi =…
Charles
  • 11
  • 2
1
vote
0 answers

Why is the WMI connection, established to a remote PC, closed after a while on my PHP page? (I want that it stays open as long page is open)

I am reading some values like Operating system version, CPU Load, Memory Size... with WMI from a remote PC. At top of my PHP script I am building a connection to the remote PC and then query informations. When I open my page the first time it takes…
Mdarende
  • 469
  • 3
  • 13
1
vote
0 answers

Retrieving Devices and Printers Information from Control Panel using Python

I am using Python 3.9.12 and using wmi package. I am trying to retrieve Model name of the mouse and keyboard for my tool. Whenever I am using wmi.Win32_PointingDevice() or wmi.Win32_Keyboard() in order to get the model name; I am getting USB Input…
Marie
  • 11
  • 1
1
vote
1 answer

Calling IWbemServices.GetObject() with JNA and Java?

I wish to use WMI from Java language with JNA package. I am able to successfully run a WQL query: import com.sun.jna.platform.win32.COM.Wbemcli; Wbemcli.IWbemServices svc = WbemcliUtil.connectServer("ROOT\\CIMV2"); Wbemcli.IEnumWbemClassObject…
remi.chateauneu
  • 109
  • 2
  • 9
1
vote
1 answer

Trying to group __InstanceCreationEvents from WMI Query -

I have a WMI query that notifies me on USB insertions, but I am trying to group the results of this query so that my handler can operate on a batch of these insertions, as opposed to one by one as they come in. WQL supports a GROUP WITHIN clause…
TheJay
  • 11
  • 2
1
vote
3 answers

CPU Usage using WMI & C#

How can i retrieve the current CPU usage in c# using WMI? I've seen plenty of posts using performance counters, but I need a solution that can work with remote machines. I've also found a VB solution here, but I'd prefer to accomplish this in C# if…
JPero
  • 1,272
  • 16
  • 21
1
vote
2 answers

Powershell CSV Output Issue

Can anyone assist my with explanation as to why I get System.String[] as my Gateway output in the CSV file but it works fine in the ISE view/window. $testcomputers = Get-Content -Path 'C:\Users2\101.txt' $exportLocation =…
CrowbarTM
  • 23
  • 4
1
vote
2 answers

How to parse the output of the Windows command `wmic` using PowerShell

I am trying to parse the output of: wmic copmutersystem and net.exe config workstation using PowerShell to get an object as Key/Value pair and/or convert it to JSON String. I know there is a PowerShell equivalent command: Get-CimInstance -Class…
tarekahf
  • 738
  • 1
  • 16
  • 42