Questions tagged [wmi-query]

Query over the content of CIM repository on Windows Machines that uses WQL (Windows Management Instrumentation Query Language ).

545 questions
4
votes
2 answers

How do I get the available FreeSpace from a drive from a remote computer?

I'm trying to get the FreeSpace from the D drive of a remote computer. Towards the end, I'm getting a ManagementException was unhandled by user code "Not Found" This is the line that gives me the error: fs = m["FreeSpace"].ToString(); Here's my…
JJ.
  • 9,580
  • 37
  • 116
  • 189
4
votes
1 answer

Why would a WMI query fail sometimes, but not others?

I run the same code from two different locations in my application. I know it is the same code, because it is in a class and that class only has one publicly facing function. Both places call the function with the same arguments and both are…
Matt Zappitello
  • 785
  • 2
  • 11
  • 30
4
votes
2 answers

Getting InvalidOperationException while calling GetOwner

In the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Management; using System.Diagnostics; namespace Test { class Program { static void Main(string[] args) …
Xolve
  • 22,298
  • 21
  • 77
  • 125
4
votes
1 answer

Is the PNPDeviceID unique

I wonder if the PNPDeviceID of an USB drive is unique (at least for a charge of identical devices) and if the ID does not change.
adjan
  • 13,371
  • 2
  • 31
  • 48
3
votes
0 answers

WMI query to Win32_Directory not returning all results

I'm running some WMI queries against a remote computer (from JavaScript/JScript, WMIC, a downloaded WMI query tool -- it makes no difference), to which I have adminstrator privileges. The query is against the Win32_Directory class and it attempts to…
jimbobmcgee
  • 1,561
  • 11
  • 34
3
votes
1 answer

how to get hardware-id for a network adapter programmatically in C#

I need to query the Hardware-Id for a network adapter using C#. Using the System.Management i can query the details of deviceID,description etc. but not the hardware id. where, listBox1 is a simple listbox control instance for showing the items on…
this-Me
  • 2,139
  • 6
  • 43
  • 70
3
votes
1 answer

Why is my WMI query for CIM_LogicalDisk events returning Win32_LogicalDisk events but not Win32_MappedLogicalDisk events?

I have a System.Management.WqlEventQuery listening for the "__InstanceOperationEvent" event. This event is the base class for the "__InstanceCreationEvent", "__InstanceDeletionEvent", and "__InstanceModificationEvent" events, so it captures all…
Triynko
  • 18,766
  • 21
  • 107
  • 173
3
votes
0 answers

Detect power state changes in modern standby

I need to detect power state changes in Modern Standby. In my specific use case, I'm trying to detect (and react) to S0 low-power (sleep) on a Microsoft Surface Pro. So far, I have tried these methods from a plain Console Application (VS…
Werner
  • 1,229
  • 1
  • 10
  • 24
3
votes
1 answer

Problem with remote install by WMI : the installation package is not accessible form the remote machine

I want to install a MSI package on a remote computer. The local and remote computer both are members of a domain called "adn.lan" and the user/password I pass as parameter to connection has full access to remote machine. When I set…
m-abdi
  • 540
  • 1
  • 7
  • 30
3
votes
2 answers

Hyper-V/WMI programming Question

I've looked at several objects in the "root\virtualization" name space but I have not been able to find where Hyper-V stores the path to the config file for a given virtual machine. I need to get this file path programmatically or at least just the…
James
  • 12,636
  • 12
  • 67
  • 104
3
votes
1 answer

Read windows registry info from remote system using Jacob

Im trying to run some WMI queries using JACOB, and so far i've been successfull in getting the services and processes however i need to query the registry to see if a certain key is there i've stummbled across this link but i dont understand how to…
naoru
  • 2,149
  • 5
  • 34
  • 58
3
votes
0 answers

WMI query generic failure when accessing MDM_VPNv2_01 class

I am trying to setup auto VPN on Windows 10 laptop and created a Powershell scripted as suggested in https://learn.microsoft.com/en-us/windows-server/remote/remote-access/vpn/always-on-vpn/deploy/vpn-deploy-client-vpn-connections. I am using the…
Arun Kaushal
  • 593
  • 3
  • 16
3
votes
1 answer

WmiMonitorID - Converting the results to ASCII

Am attempting to query the serial number and the model of the monitor. I managed to use the WMI code creator to generate the below code: Try Dim MInfo As New ManagementObjectSearcher("root\WMI", "SELECT * FROM WmiMonitorID") For Each…
Wilson Toh
  • 47
  • 6
3
votes
1 answer

WMI query on VolumeChangeEvent for SD card insertion into SD card reader not working

I'm developing an application where I would like to process data automatically from an SD card when it's inserted in an SD card reader. The SD card reader is inserted into the computer and assigned the E: and F: drives and are greyed out when…
SJoos
  • 91
  • 8
3
votes
1 answer

How to detect antivirus installed on windows 2003 server and 2008 server 2003 server R2and 2008 server R2 using WMI or other then WMI in C++

i have used WMI to detect that antivirus is present on OS, itz woking fine and display me information of antivirus like name and instance id on win xp and window7 by using Namespace:\root\SecurityCenter and \root\SecurityCenter, …
Sourabh Gupta
  • 31
  • 1
  • 3