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

Running PowerShell as different user and credentials

I am working on a project using PowerShell, and the challenge that I have now is how to run PowerShell itself. I have access to a domain credential that has login capability on the server I am running it from, and I am planning on using WQL queries…
Acerbity
  • 417
  • 1
  • 11
  • 29
0
votes
0 answers

WMI query returns no result C++

I'm connecting to Windows server 2012 and 2008 R2 from a Windows 7 machines. My code is working in some computers but in some computers when I run my app query always return NULL. When I execute Next method on IEnumWbemClassObject object it returns…
0
votes
0 answers

Win32_Keyboard Class of WMI not detecting PS/2 keyboard in C++

I have used the following code in my C++ program( in VS2010) written for device monitoring. hres = pSvc->ExecNotificationQueryAsync( _bstr_t("WQL"), _bstr_t("select * from __InstanceOperationEvent within 1 " …
Jackzz
  • 1,417
  • 4
  • 24
  • 53
0
votes
1 answer

Is there a way to programmatically modify a report in SCCM 2012?

I am part of a team that is working on moving over our existing SCCM system from 2007 to 2012. The reports have been migrated over, but most of the queries do not work due to inconsistencies in the table and column names. As a result, I need to…
Phil Gabardo
  • 142
  • 11
0
votes
1 answer

Which method made the call to IWbemObjectSink::Indicate method

I am developing an application in C++ using VS2010. In my code,I have two WQL queries as follows: hres = pSvc->ExecNotificationQueryAsync( _bstr_t("WQL"), _bstr_t("SELECT * " "FROM __InstanceDeletionEvent WITHIN 1 " …
Jackzz
  • 1,417
  • 4
  • 24
  • 53
0
votes
0 answers

WQL query for notification on process creation/termination

I have a WQL query as follows that lists all the running processes of my system. ExecQuery( bstr_t("WQL"), bstr_t("SELECT * " "FROM Win32_Process"), WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, …
Jackzz
  • 1,417
  • 4
  • 24
  • 53
0
votes
1 answer

Query Eventlog Records Between Dates

I am writing a VBScript which attempts to query the WMI system logs for start up and shutdowns within the current month and unfortunately I'm hitting an automation error with the query I have created. I have a function that will dynamically create a…
0
votes
1 answer

WQL query returns multiple instances in collection

I'm running a WQL query in VBScript to pull data from our SCCM database. I can do other queries that all work as expected. They usually return an object collection that I can loop through and access using the standard method: For Each objGroup in…
0
votes
1 answer

Composing a query in WqlEventQuery for more than 1 network adapter fails in c#

I'm trying to detect DNS changes for 2 network adapters. I'm using c# .net 4.0 on win 7 64 bit machine. The code for listening to win registry keys of network adapters(inside RegisterToDNSChanges): using System; using…
Lucian
  • 874
  • 11
  • 33
0
votes
2 answers

VBScript to check driver status with WQL query

I'm trying to write a script that will check if a device is currently at an error level (has a yellow bang in Device Manager). The ultimate task I'm trying to automate is installing a driver, checking if it installed correctly, uninstalling, and…
0
votes
2 answers

How to achieve the folder size property in c# using wql?

I want to display the folder and file size in list view which is placed in my form. Is it possible to achieve the folder size at the whole(including sub folders and files) and display it from remote computer? With the following code, i can get the…
gkrishy
  • 756
  • 1
  • 8
  • 33
0
votes
1 answer

WMI Query returning null collection when querying Win32_Directory

I'm trying to use VBScript to select all csv's in a specific folder and then concatenate them into one. I am adding all of the csv's to a collection using ExecQuery on Win32_Directory, specifying the path and the extension properties. I have five…
Adam Harvey
  • 55
  • 1
  • 2
  • 10
0
votes
1 answer

Comparing WMI DateTime to String in Query

I'm trying to query Win32_NTLogEvent for entries past the previous time that I ran the query. I've tried using a string variable so that I can change it every time I run the script. But I am getting a null returned for the generated collection. I've…
Adam Harvey
  • 55
  • 1
  • 2
  • 10
0
votes
1 answer

Query to Select All Non-Essential Temporary Files

I am trying to write a script to delete unneeded temporary files. I am wanting to specifically target .tmp's, though. At least for now. So I am trying to write a WQL query to return a collection with which I can use a FOR EACH statement to delete…
Adam Harvey
  • 55
  • 1
  • 2
  • 10
0
votes
1 answer

How to use concat() method in wql?

I am develop wmi application to get windows logs by using WQL query. How to use CONCAT() method in that query. Input WQL Query : wmic -U XXX%XXX //XXX "Select CONCAT(Category, '|DHCP') from Win32_NTLogEvent where TimeWritten > '06/04/2014 13:59:00'…
Kannan Arumugam
  • 1,119
  • 2
  • 18
  • 27