Questions tagged [wql]

The WMI Query Language (WQL) is a subset of the American National Standards Institute Structured Query Language (ANSI SQL)—with minor semantic changes.

Windows Management Instrumentation Query Language (WQL) is Microsoft's implementation of the CIM Query Language (CQL), a query language for the Common Information Model (CIM) standard from the Distributed Management Task Force (DMTF). It is a subset of the standard ANSI SQL with minor semantic changes. A basic WQL query remains fairly understandable for people with basic SQL knowledge.

WQL is dedicated to WMI and is designed to perform queries against the CIM repository to retrieve information or get event notifications

198 questions
1
vote
3 answers

When querying the Win32_NTLogEvent Class from WMI with WQL is the TimeGenerated property based on Local time of the computer or GMT?

I am writing a C# windows service that is doing some churning through the eventlog on a few domain controllers. Some of them are Windows Server 2003 and some are Windows Server 2008. Upon the service stopping I am attempting to resume where I left…
jpmcclung
  • 109
  • 2
  • 9
1
vote
1 answer

WQL for REF properties: PowerShell vs C#

The simple query works fine in PowerShell: gwmi -Query "select * from Win32_DependentService where Antecedent='\\\\MYPC\\root\\cimv2:Win32_SystemDriver.Name=`"WdFilter`"'" but it doesn't work in C#: var scope = new…
Andy
  • 11
  • 1
1
vote
0 answers

WMI event notification in C++

Can anyone help me in writing the WMI query to get event notification when a speaker or headphone/MIC is connected to my system. I tried SELECT * FROM __InstanceOperationEvent WITHIN .1 TargetInstance ISA 'Win32_SoundDevice'. But it doesn't seems…
Jackzz
  • 1,417
  • 4
  • 24
  • 53
1
vote
1 answer

Select WMI TargetInstance from multiple classes?

I am a C++ programmer working in VS2010. Currently I am using WMI to monitor the processes and devices in the system. While writing WQL query, is it possible to select the TargetInstance from multiple classes? For example, instead of select * from…
Jackzz
  • 1,417
  • 4
  • 24
  • 53
1
vote
1 answer

C++: Monitor process creation and termination in Windows

I happened to see the following portion of code here. $Obj.ExecNotificationQueryAsync($hObj, "SELECT * FROM __InstanceCreationEvent WITHIN 0.5 WHERE TargetInstance ISA 'Win32_Process'") $Obj.ExecNotificationQueryAsync($hObj, "SELECT * FROM…
Jackzz
  • 1,417
  • 4
  • 24
  • 53
1
vote
0 answers

C# WMI Query: How do I drill down farther into object type System.Management.ManagementBaseObject?

I am trying to programmatically query WMI for SAN WWN numbers on a database server. I am using WMI namespace root\wmi, and class MSFC_FibrePortHBAAttributes. My problem is that I can get to the Attributes property of this class, but I can not drill…
corneria
  • 608
  • 3
  • 11
  • 24
1
vote
1 answer

Can Get-CimAssociatedInstance differentiate between antecedent and dependent win32_services?

I'm trying to get a list of associated instances for a win32_service, and then separate those instances based on whether they "depend on" or are "required by" the win32_service. For example, I can get a list of associations for the WAS…
Ci3
  • 4,632
  • 10
  • 34
  • 44
1
vote
1 answer

SELECT PercentTimeinGC FROM Win32_PerfRawData_NETFramework_NETCLRMemory

hope you are well. Goal: extract WMI data FROM Win32_PerfRawData_NETFramework_NETCLRMemory PercentTimeinGC, like shown in perfmon = ".NET CLR Memory / % Time in GC" Enviroment IIS 7, Worker process Garden (4) (ASP .NET4.0 app pools) (4xw3wp.exe…
Mike
  • 11
  • 2
1
vote
2 answers

PowerShell SCCM display Status Message Queries

I'm currently programming some right-click tools in PowerShell for the SCCM 2012. I'd like to program a tool, which displays the Status Message Queries of the right-clicked device. I'd like to have a smiliar view as the SCCM -> Monitoring ->…
faebuk
  • 51
  • 2
  • 8
1
vote
1 answer

Constructor ManagementObject(string path) fails to parse strings obtained from querying Win32_GroupUser class (C#)

So, I WMI query a remote machine to get the members of its Administrators group: SELECT PartComponent FROM Win32_GroupUser WHERE GroupComponent = "Win32_Group.Domain='MACHINE_NAME',Name='Administrators'" It returns the PartComponent property as…
JCCyC
  • 16,140
  • 11
  • 48
  • 75
1
vote
4 answers

WQL SELECT with optional column

I need to make a query like this: SELECT PNPDeviceID FROM Win32_NetworkAdapter WHERE AdapterTypeId = 0 Trouble is, the AdapterTypeId column isn't always present. In this case, I just want everything, like so: SELECT PNPDeviceID FROM…
NPVN
1
vote
1 answer

Detect USB devices event

I made a console application which detects plugin and plugout events for all type of usb devices. but I wanted some filteration in it like I wanted to detect only webcams . This was done by using GUID class. The class for webcam is 'Image' class…
1
vote
0 answers

wmi wql query of etw event source

How would I go about subscribing to a WMI event which notifies me of a new entry in the error log? The error log in question would be generated as a result of a call to an ETW event source. I've noticed the following WMI query: SELECT * FROM…
jaffa
  • 26,770
  • 50
  • 178
  • 289
1
vote
1 answer

WQL Subquery as field value, CIMV2 WMI WQL query for WMI-Filter

I need help on a WMI query for a Group Policy WMI-Filter. I'm querying the win32_group namespace within the root\CIMV2 WMI provider. I am doing a search for a Local Security group (like "Administrators") on several window's computer (XP-8, server…
Dan
  • 11
  • 4
1
vote
3 answers

WQL query for clients by minimum OS Version Number

Say I needed a WQL query to find clients running Windows 8 or greater: WQL query Windows 8 or Greater SELECT Version FROM Win32_OperatingSystem WHERE Version >= '6.2' Wouldn't you run the risk of this also including Versions 6.10 (assuming that in…
Doug Coburn
  • 2,485
  • 27
  • 24