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
How to use Win32_Tpm module in python
I have installed WMI for python and pywin32 extensions to be able to use win32 apis from my python scripts. While I can get all the info from other clasees like Win32_Battery, Win32_Processor I am having tough time with Win32_Tpm class.
I want to…
0
votes
1 answer
Read DWORD registry value in 64 bit
How I can read DWORDregistry value in 64 bit machine?

John
- 703
- 7
- 18
- 37
0
votes
1 answer
Retrieve SQL Protocol Status
Using SQL query or WMI, I want to retrieve whether SQL protocol such as Named Pipes, TCP/IP is enabled or not.
I need to do this for SQL Server 2000, 2005, 2008.
Thank you.

John
- 703
- 7
- 18
- 37
-1
votes
1 answer
How to query Win32_Printer for installed remote printer? (Invalid Query)
I´m getting Invalid Query error when trying to get locally installed remote printer info from Win32_Printer.
string query = "SELECT * from Win32_Printer WHERE Name = '\\\\Server\\PrinterName'";
ManagementScope scope = new…

user995219
- 104
- 11
-1
votes
1 answer
WMI Object with another object as property
I have a below powershell wmi query and I want the vbscript equivalent query for the same.
(get-wmiobject ProcessorStatus -namespace root\wmi).PerfStates.State
ProcessorStatus WMI class contains Perfstates property which is an object of…

Arun
- 2,247
- 3
- 28
- 51
-1
votes
1 answer
Filtering WMI query
I have a bit of VBS that is used to query domain machines for their installed printers and output details to a spreadsheet in four columns.
objExcel.Cells(1,1).Value = "Machine Name"
objExcel.Cells(1,2).Value = "Printer…

Martin
- 21
- 1
- 1
- 5
-1
votes
1 answer
Getting the disk signature as negative
import wmi
wmi_connector = wmi.WMI()
def get_win_drive_mappings_locally(drivemappings):
for physical_disk in wmi_connector.Win32_DiskDrive():
for partition in physical_disk.associators("Win32_DiskDriveToDiskPartition"):
…

Vishnu Imp
- 5
- 1
- 7
-1
votes
1 answer
Trying to get Juniper Firewall Configured
I will be honest, I am not a firewall guy.
I have been working on a number of Change Controls to get our Juniper Firewall configured to allow the ability to run WMI Queries via PowerShell.
For Example:
$time =…

Leptonator
- 3,379
- 2
- 38
- 51
-1
votes
1 answer
Memory leak in IWbemServices->ExecNotificationQuery?
I have a WMI-related code, that gets an event, once new app is started.
I've skipped initialization part, here is the code. Note, that everything is working, all HRESULTs are S_OK.
IEnumWbemClassObject* pEnumerator =…

Starl1ght
- 4,422
- 1
- 21
- 49
-1
votes
1 answer
WMI Enumerate Win32_GroupUser with friendly output
I'm trying to enumerate all existing groups on my local machine.
That's what I tried using wmi :
string _class = "Win32_GroupUser";
string namespace = "\\\\.\\ROOT\\cimv2";
ManagementClass _class = new ManagementClass(namespace + ":" + class ); …

ShEp
- 87
- 1
- 5
-1
votes
2 answers
VBScript OS Prop
I´m creating a VBScript to get OS information (to workstations and servers), At this point I need a function that gives me the OS Edition ONLY, example
WScript.Echo "Operating System Edition: " Standard
WScript.Echo "Operating System Edition: " …

JPKI
- 71
- 6
-1
votes
4 answers
WinApi Base Services tutorial?
I need to make application which gathers basic data about system, like OS version, processor & memory type, data about installed programs...
Application will be written in c and will work on Win Server 2000 and 2003. So first thing on my mind was…

shake
- 323
- 9
- 23
-1
votes
1 answer
WMI win32_physicalmedia or win32_diskdrive result prob
I'm using visual c++ 2010.
Im trying to retrieve harddisk serial number using win32_physicalmedia or win32_diskdrive and it's working normally but on alot of pcs it displays the serial number more than once and sometimes with symbols and…

user3735032
- 73
- 1
- 1
- 8
-1
votes
1 answer
wmi query not returning data for a specific server
I have below perl script to get sites information from different servers. The script is working fine except for one server.
#!C:/perl/bin/perl
use strict;
use Win32::OLE('in'); # WMI access and optimised flags
use constant…

Mohammad Nadeem
- 9,134
- 14
- 56
- 82
-1
votes
2 answers
I'm using WMI in C# to get all the installed softwares but it doesn't show all the softwares only Microsoft ones
public ManagementScope GetScope()
{
try
{
//string classScope="winmgmts:" + "{impersonationLevel=impersonate}!\\" + strComputer + "\\root\\cimv2";
string serverString = @"root\cimv2";
…

Khaleel Hmoz
- 987
- 2
- 13
- 24