Query over the content of CIM repository on Windows Machines that uses WQL (Windows Management Instrumentation Query Language ).
Questions tagged [wmi-query]
545 questions
7
votes
3 answers
how to check service state using vbscript?
Is there anyway to check the status of service using vbscript ? I would like to have a function for each possible service state :
LINK
Any help would be great. I did write a function for checking if service is stopped :
Public Function…

Anh Nguyen
- 313
- 5
- 11
- 22
6
votes
2 answers
Updating via WMI
I need an example of an update query using WMI. I have searched but I couldn´t find anything.
Can anyone paste some sample code if possible?
Thanks.

NicoRiff
- 4,803
- 3
- 25
- 54
6
votes
1 answer
How to export all rows of a WMI query to a file?
Given a query such as
SELECT * FROM WIN32_PROCESS
Is there a way to interrogate the result object for the names of the columns returned?
Write all the rows in the result object to a text file, say

AAsk
- 1,431
- 4
- 17
- 25
6
votes
4 answers
Query WMI remotely with PHP
My current code looks like this:
define ( 'CPU_NAME', 'remote_server' );
$obj = new COM ( 'winmgmts:{impersonationLevel=impersonate}//' . CPU_NAME . '/root/cimv2' );
if ( is_object ( $obj ) ){
$process = $obj->execquery ( "SELECT * FROM…

John Moses
- 1,283
- 1
- 12
- 18
6
votes
4 answers
Alternative to Win32_Product?
After playing around with querying Win32_Product to find a software version, I couldn't understand why the results were so dog-slow. As much as 15 times slower than querying Win32_service or Win32_process. So coming here to see if I'm missing…

James Brown
- 327
- 2
- 11
- 21
6
votes
3 answers
Get Link Speed - Win32_PerfRawData_Tcpip_NetworkInterface
I found Determining the network connection link speed
and now I am trying to correlate the data from Win32_PerfRawData_Tcpip_NetworkInterface with
Win32_NetworkAdapter (or Win32_NetworkAdapterConfiguration).
On the class…

Milde
- 2,144
- 3
- 17
- 15
6
votes
1 answer
ManagementException - Invalid Class
I am having an issue querying WMI that has me completely baffled. The Application I am building utilizes WMI counters that are installed as part of the VMware View Agent into a VDI desktop. The counters provide information about the remote display…

Rex Remus
- 171
- 1
- 9
6
votes
1 answer
Powershell get-item VersionInfo.ProductVersion incorrect / different than WMI
I'm trying to understand why Powershell would get back a different version number for a DLL file than what both the file properties page from Windows Explorer, and a WMI query shows. (I apologize in advance if this doesn't correctly qualify as a…

jschleicher
- 63
- 1
- 1
- 3
6
votes
3 answers
List of WMIEvent classes
Recently I have been learning about WMI and WQL. I found out the list of Win32 classes (from MSDN) that I can query for but I am not able to find out the list of event classes (should be the subset of the list of Win32 classes isn't it ?) Does any…

sudarsanyes
- 3,156
- 8
- 42
- 52
5
votes
1 answer
WMI query in C# does not work on NON-English Machine
I am creating an application that needs to track when a process starts, then raise an event when it's finished.
I have code that works perfectly, and does exactly what I need on an English machine, but when I run the same application on a French…

SmithMart
- 2,731
- 18
- 35
5
votes
1 answer
Powershell - check if a CD is in CD-ROM drive
Is this possible?
My first guess would be something like:
C:> Get-WmiObject Win32_CDROMDrive
But when I tried this, it only tells me Caption, Drive, Manufacturer,VolumeName
No information on whether or not there is a CD in the disc drive.

Kellen Stuart
- 7,775
- 7
- 59
- 82
5
votes
1 answer
using WMI to uninstall applications remotely
I am trying to write a mini w32 executable to remotely uninstall an application using WMI.
I can list all the installed applications using this code below but i couldnt find a way to uninstall the application remotely thru WMI and C#
I know I can…

Nooneelse
- 127
- 2
- 11
5
votes
0 answers
USE WMI and WMQ to get Logical Disk and Partition Information from Win32_PnPEntity of SERVICE type USBSTOR
I am detecting when our proprietary USB device is attached to a PC. When we detect this, we get the related Win32_PnPEntity. We want to use this Win32_PnPEntity as a source of the following information:
- USB Descriptor VID, PID, REV, Firmware…

Ian McShane
- 340
- 3
- 10
5
votes
3 answers
WQL does not support TOP - need workaround
WQL (basically SQL for WMI) does not support a TOP or LIMIT keyword. Sql Server used TOP and many other RDBMSs supprt LIMIT etc.
Is there a workaround to emulating a SELECT query to behave as though it had a TOP/LIMIT clause that limits the result…

Paul Sasik
- 79,492
- 20
- 149
- 189
4
votes
3 answers
Decrease WMI query execution time
In my application i want to see if windows 7 is activated.
To be clear, i do not want to check if windows are genuine.
I use the code below, found here http://www.dreamincode.net/forums/topic/166690-wmi-softwarelicensingproduct/
The time needed to…

vandervagos
- 113
- 3
- 7