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
0
votes
2 answers

How to Subscribe to Windows File Modification Events

I am trying to subscribe to the event of a specific file being modified using WQL with this query: SELECT * FROM __InstanceModificationEvent WITHIN 1 WHERE TargetInstance ISA "CIM_DataFile" AND TargetInstance.Drive="C:" AND…
Bassie
  • 9,529
  • 8
  • 68
  • 159
0
votes
0 answers

Get file size of a running Windows executable using WQL

Is there a way to compute the file size of a Windows process executable using a WQL query? I tried the below but Powershell gave me a management exception. SELECT Caption, ExecutablePath, CommandLine From Win32_Process, (SELECT FileSize FROM…
verisimilitude
  • 5,077
  • 3
  • 30
  • 35
0
votes
1 answer

MofComp Subscription not Working and Saved File Acting Strange

I am trying to register this file (mytest3.mof) : #PRAGMA AUTORECOVER #pragma namespace("\\\\.\\root\\subscription") instance of __EventFilter as $EventFilter { Name = "Event Filter Instance Name"; EventNamespace = "Root\\Cimv2"; Query…
Bassie
  • 9,529
  • 8
  • 68
  • 159
0
votes
2 answers

WMI EventLog Time interval

Hie all, I'm trying to get eventlog entries using WMI and WQL. I can get the right log with the right sourcename of itand so on, but i can make a select query to only get result for the 5 or 10 past minutes. here is my query:
mike42
  • 1
  • 1
  • 1
0
votes
0 answers

Why are there some System Properties missing, when using join in query? (powershell, get-wmiobject)

I ran into following problem: When i´m running a query where there is a join inside, then the systemproperty "__PATH" is empty. When im running it without the Join, everything works fine: Working: $apps = Get-WMIObject -Namespace…
R. Ibk
  • 1
  • 2
0
votes
1 answer

Response size limitations in WMI

I need to get custom user objects using WMI from a remote server. It's possible that number of users is > 500,000. Is it safe to run the following code? var queryStr = "select * from MyUserClass"; var query = new SelectQuery(queryStr); var searcher…
fresh
  • 33
  • 1
  • 7
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

ManagementObjectSearcher on WMI array property

I'm running the following code in attempt to get the ChassisType of the device it is run on. string wmiQuery = string.Format( "SELECT ChassisTypes FROM Win32_SystemEnclosure"); ManagementObjectSearcher searcher = new…
FishFenly
  • 23
  • 1
  • 1
  • 6
0
votes
1 answer

Duplicate results from SQL Inner Join (SCCM 2012 WQL)

I am trying to return rows containing items from SCCM 2012 using WQL (which is essentially SQL) and I am getting duplicate rows in my results when I modified it to pull in information from another table using an inner join (Originally I did not care…
Marcus
  • 3,216
  • 2
  • 22
  • 22
0
votes
2 answers

WQL request working in console application but not in Windows service

I'm currently working on a 'monitoring' solution. The idea is to set eyes on a remote ressource and alert user when avaiable disk space goes below a defined threshold. The app is a Windows service. A timer is launched and make a WQL request every x…
TazMayhem
  • 25
  • 5
0
votes
0 answers

Thanks Does Win32_NetworkAdapter "index" property of an adapter change in any circunstance?

I'm working on a project who have a licensing feature. It is licensed to the machine where it is installed, so, to generate a unique ID for the machine I'm using the MAC address of the network adapter. I'm using WMI to retrieve it. This works fine…
Tyras
  • 103
  • 1
  • 7
0
votes
1 answer

WQL Query for Software inventory

I have to make a query in sccm to get all Clients with a specific Software installed. But i have no idea how to get this Job done. I've tried this on but, it's not accurate enough. select SMS_G_System_SYSTEM.Name from SMS_R_System inner join…
N.R.
  • 230
  • 3
  • 11
0
votes
1 answer

WSMAN and WMI System Properties

I'm trying to retrieve __PATH property in WQL query. When I trying to enumerate it using WSMAN and WQL query, it returns only ProcessId . Get-WSManInstance -Enumerate wmicimv2/* -filter "SELECT __PATH, ProcessId FROM Win32_Process" But it is easy…
John
  • 454
  • 2
  • 5
  • 18
0
votes
1 answer

How can I query WMI GroupUser objects when a group name contains single quotes?

This should seriously be a trivial escaping issue, but I can't query WMI for a group like so: SELECT * FROM WIN32_GroupUser WHERE GroupComponent="Win32_Group.Domain='TESTWIN7DEVEL-P',Name='Alaenna's Smile'" This returns a WMI error as shown here…
hakusaro
  • 133
  • 2
  • 10
0
votes
0 answers

Why does this work as a WQL query?

I'm writing a Powershell script and am querying the local DNS resource for both CNAME and A records matching specific criteria (specifically against HP servers). Using full administrator access rights using WQL against the root\MicrosoftDNS…
Dan
  • 106
  • 4