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
1 answer
Microsoft Server 2012 R2 WMI (virtualization/v2) not detecting virtual machines - VBScript
As the title indicates, I'm currently unable to retrieve a list of virtual machines with a WMI query in VBScript. Hyper-V manager is correctly identifying 3 Virtual Machines on the Host in question, but when I query WMI I only see the Host…

Eric
- 1
- 1
- 1
0
votes
1 answer
Get Mapped Network drives from remote machine in C#
I want to list mapped network drives in remote machine using WMI C#.. I am using following code
ConnectionOptions connectionOptions = new ConnectionOptions();
connectionOptions.Username = "myAdminUser";
…

kombsh
- 387
- 2
- 3
- 14
0
votes
1 answer
List 3rd party drivers thru Powershell 3.0
I am trying to get the list of 3rd party drivers installed on a Windows 8 machine.
gwmi win32_systemdriver| ? ((Get-ItemProperty $psitem.pathname).VersionInfo).companyname -NotLike *microsoft*
Error : Get-ItemProperty : Cannot bind argument to…

Ayan Mullick
- 67
- 2
- 11
- 38
0
votes
2 answers
Retrieve all .doc files exist in My Computer for a search term which user provides. Is it possible?
Retrieve all .doc files exist in My Computer using a search term which user provides. I have tried to query systemindex catlog and the problem is, it is not fetching the documents which is recently added.
My code is like below
SELECT…

user3366358
- 23
- 1
- 6
0
votes
3 answers
C# repeating lines of code vs using properties from a memory usage perspective
I'm wondering if there's a better way to implement the following code from a maintainability and a memory impact standpoint. Looking at the following code would it be better to use properties? I see a lot of repeat code and I'm wondering what the…

Gabriel W
- 155
- 1
- 7
0
votes
1 answer
WMI escape characters on string variable programatically
i have this working query
ManagementObject pnpdevice = new ManagementObjectSearcher(String.Format(
"select * from Win32_PnPEntity where DeviceID='{0}'",
"USB\\\\VID_046D&PID_C52B&MI_00\\\\6&48E0D58&0&0000")).First();
where i just realized that i…

Josh
- 831
- 1
- 15
- 31
0
votes
1 answer
How can I test whether or not "Microsoft Windows 7 Home Premium" is the operating system using VBScript?
My first attempt is to query Win32_OperatingSystem for the caption, and test whether the caption "equals" the operating system I am testing for:
Dim objWMIService, strComputer
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &…

JohnZaj
- 3,080
- 5
- 37
- 51
0
votes
2 answers
How to retrieve values from WIN32_NetworkAdapter using WMI in C++? I am unable to understand the VARIANT used to access the values after the query
Win_32 NetworkAdapter, Win32_SignedDriver,
How to retrieve values from WIN32_NetworkAdapter using WMI in C++? I am unable to understand the VARIANT used to access the values after the query.

user3194643
- 13
- 3
0
votes
1 answer
using commandline to verify that a Deployment Type has a Global Condition
Currently scripting for SCCM to automate
creation of collections
populating collections
etc..
I'd like to add a "verification" step.
I want to ensure (through commandline since I want to automate it) that a Deployment Type has at least one Global…

projetnumero9
- 61
- 2
- 13
0
votes
2 answers
WMI event processor useage vs WMI query
I want to be able to detect a change in the list of installed programs on a pc using wmi.
I have 2 options 1- run a wmi query every X seconds and compare to a saved file containing the list. 2 - start a Wmi event that polls every X seconds.
Which…

user1438082
- 2,740
- 10
- 48
- 82
0
votes
0 answers
Event for an existing query using WMI
If I have WMI query to get the status of something,is there an associated event that can listen for a change to that status. For example - i can query a motherboard serial number but is it possible to detect a change to the serial in the form of an…

user1438082
- 2,740
- 10
- 48
- 82
0
votes
1 answer
Unique Identification of a particular device type
Win32_PnPEntity class has so many properties but I want to know that is there any property which identifies the type of device uniquely . For example I have a fingerprint scanner device and its device id is something like this "USB\VID_0A86" but as…

Muhammad Ashhar Hasan
- 289
- 6
- 14
0
votes
1 answer
WMI Permanent Event When PC is Shutdown
I want to know if a USB key has been plugged out. This can be achieved easily using a WMI Event listener. But what if the PC is shutdown - will a WMI permanent event detect this ?

user1438082
- 2,740
- 10
- 48
- 82
0
votes
2 answers
Querying process by CommandLine
I'm trying to do the following query in WMI:
SELECT ProcessID from Win32_Process where CommandLine='C:\Windows\system32\calc.exe'
But I got an "Invalid query" error. I also tried with:
SELECT ProcessID from Win32_Process where…

Vito
- 718
- 4
- 16
- 37
0
votes
1 answer
What's wrong with my WMI query?
I'm trying to invert the following query:
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = 4856")) {
foreach (ManagementObject mo in searcher.Get()) {
…

Hein Andre Grønnestad
- 6,885
- 2
- 31
- 43