Query over the content of CIM repository on Windows Machines that uses WQL (Windows Management Instrumentation Query Language ).
Questions tagged [wmi-query]
545 questions
0
votes
0 answers
Executing a WMI method from C++ fails with WBEM_E_INVALID_METHOD_PARAMETERS
I'm trying to call a method from WMI using C++. But the pNamespace->callMethod(..) fails with an error WBEM_E_INVALID_METHOD_PARAMETERS (0x8004102F).
I'm trying to call a method from..
Namespace: ROOT\WMI
Class: CLEVO_GET
Method: SetKBLED (Static =…

Robert Koszewski
- 583
- 1
- 8
- 17
0
votes
1 answer
WMI Instance update fails
I'm trying to update a WMI instance using C# following one example in MSDN but I cannot get it to work. It is firing me a 'System.Management.ManagementException' which does not give me any answer. Can you please tell me if I'm doing something…

NicoRiff
- 4,803
- 3
- 25
- 54
0
votes
1 answer
Invalid WMI query
I have a server list that feeds into a function. I'm looking to query each machine and get an entire list of all files and folders. Id like to write a file to my local machine, the file name will be the the targets ip ($computer) and append all the…

iNoob
- 1,375
- 3
- 19
- 47
0
votes
1 answer
Add JOIN and DISTINCT support at WQL
Is there a way to extend WQL to add the support of key word like JOIN and DISTINCT?
It seems that Microsoft has do the job in System Center 2012 Configuration Manager but I don't find where find the assemblies and how reuse it.

Troopers
- 5,127
- 1
- 37
- 64
0
votes
1 answer
Powershell Script using Get-Wmi Object to get last password change date for local users on remote computers
I need a script to run against all of the machines in my domain to get Local account details. I want to use Get-WMIobject if possible because it works on remote machines without opening up extra security. I have used Get-WmiObject win32_User account…

J Maloney
- 1
- 1
0
votes
1 answer
wmi call returning Unexpected COM Error error
I have code as below which runs in a thread for every 60sec.
import wmi
import threading
CPU_DATA = {}
class CpuCollector(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.sleep_time = 60
…

Chetan
- 1,217
- 2
- 13
- 27
0
votes
2 answers
How to add the computer name in LogicalDisk Powershell WMI Query
In the query below, I'd like to add the $srv value under the ServerName for each row.
[string]$srv = 'someserver'
gwmi -query "select * from Win32_LogicalDisk
where DriveType = 2 OR DriveType = 3" -computername $srv | select ServerName, Name,…

A.G.
- 2,089
- 3
- 30
- 52
0
votes
1 answer
Does WMI data get refreshed while OS is running?
I have a question about Windows Management Interface data (WMI).
I know this data gets populated at the boot time. When OS keeps running without powering cycle the machine, does this WMI data ever get refreshed?
Thanks!

CodingFanSteve
- 713
- 2
- 6
- 17
0
votes
0 answers
Are WMI namespaces instances of a class?
I've been writing a program in C# to scavenge information out of WMI as a project (I know many great tools out there exist already, but this is both for learning and custom tailored to an environment I manage), and I've come across a few oddities.…

Christopher D Albert
- 57
- 1
- 10
0
votes
1 answer
How to find list of file path in files and in sub folders of C Drive based on different extension through WMI in C#
I need to search files of the extension mp3 and many more from the whole C Drive and store only its path in specific list string,currently I'm just printing on the Console I get repetitive results too .I just want to skip even if one file is…

TechBrkTru
- 346
- 1
- 25
0
votes
0 answers
WMI C++ get data from object
I implemented 1-5 steps from :
https://msdn.microsoft.com/en-us/library/aa390423(v=vs.85).aspx
Everyting works, but i have problem with getting data from object which i retreive with query.
My code:
// Step 1:…

user2667455
- 99
- 2
- 9
0
votes
0 answers
WMI Class "Win32_LogicalDiskToPartition" not found in one particular Windows 8.1
I need to access to a WMI class called "Win32_LogicalDiskToPartition". I can access to this class in many windows (XP/7/8/8.1), but I found a particular Windows 8.1 where this class is not accessed.
To test this I use Powershell, this commnad…

dlopezgonzalez
- 4,217
- 5
- 31
- 42
0
votes
0 answers
WMI does not find all devices
I tried creating a class that will see if a device driver is installed, if not set an errorlevel so that a bat file can use "dpinst.exe" to install it. This is so there will be a totally silent install. I am using WMI to read both the Entity…

penright
- 163
- 4
- 12
0
votes
1 answer
Why can't local Windows 7 Pro machine read its own WMI values?
As part of a larger .Net 4.0 program I have a piece that queries the WMI for a list of network adapters and from that creates a list<> of physical adapters with MAC addresses.
It works on the machines I've tried it on, but when sent to the client,…

Rich Shealer
- 3,362
- 1
- 34
- 59
0
votes
1 answer
C# running WMI query while loading form
I've got a C#/Winforms program that needs to list the computer's network adapters on the initial form, so this is a simplified version of my function to put together that list:
void LoadNicList()
{
ManagementObjectSearcher mos = new…

Corey O
- 15
- 4