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
11
votes
5 answers

What format is this time value in?

I have a WMI query that specifies time in this format '20090219000000.000000+480' Can someone tell me what format this is, and does .NET have any built-in functionality to work with it? EDIT This time value is from a sample query that I found. I…
TWA
  • 12,756
  • 13
  • 56
  • 92
11
votes
1 answer

How can I improve WMI performance in .NET?

I've inherited code that makes numerous remote WMI calls. When I repeatedly pause execution and look at the call-stack it's almost always in a ManagementScope.Connect() call. A new connection seems to be made with each WQL query. Despite limited…
devgeezer
  • 4,159
  • 1
  • 20
  • 26
10
votes
2 answers

How to join in a WMI Query (WQL)

I want to get the serial number of the boot-harddisk via a WQL query. The boot-partition can be retrieved using the following query: SELECT * FROM Win32_DiskPartition where BootPartition=True The serial number is in Win32_DiskDrive: SELECT…
j00hi
  • 5,420
  • 3
  • 45
  • 82
8
votes
2 answers

Process Start Event Using WMI - Not All Process Starts Being Detected

I am using the following C# code in a Windows Service (which runs as NT_AUTHORITY\SYSTEM) to create an event handler for receiving process creation events (using WMI and WQL): string queryString = "SELECT * FROM…
Xenon
  • 3,174
  • 18
  • 37
7
votes
2 answers

WMI query to Read 'Microsoft-Windows-AppLocker/EXE and DLL' C#

I have created an agent to read windows event using WMI. I ma using the agent from last 3 years to collect events. It is used in a SEIM product. The query looks like SELECT * FROM Win32_NTLogEvent where LogFile = 'System' or logFile='Active…
Elixir Techne
  • 1,848
  • 15
  • 20
7
votes
2 answers

I have a SID of a user account, and I want the SIDs of the groups it belongs to

This has to be obtained from a remote machine. The following query works not for SIDs, but for group and account names. "SELECT GroupComponent FROM Win32_GroupUser WHERE PartComponent = \"Win32_UserAccount.Domain='" + accountDomain + "',Name='" +…
JCCyC
  • 16,140
  • 11
  • 48
  • 75
6
votes
3 answers

List of WMIEvent classes

Recently I have been learning about WMI and WQL. I found out the list of Win32 classes (from MSDN) that I can query for but I am not able to find out the list of event classes (should be the subset of the list of Win32 classes isn't it ?) Does any…
sudarsanyes
  • 3,156
  • 8
  • 42
  • 52
5
votes
3 answers

How to obtain DefragAnalysis using C#

I am currently developing an application in C# (.NET 4.0) that should have as a part of its functionality the ability to determine the percentage of fragmentation on a particular volume. All the other features have been tested and are working fine…
5
votes
1 answer

C# Log SMB file access

I'm trying to make a simple log of files transferred via SMB. This works with Windows 8 or higher: var scope = new ManagementScope(@"\\.\root\Microsoft\Windows\SMB"); var query = new WqlEventQuery( @"SELECT * FROM …
Vinicius Gonçalves
  • 2,514
  • 1
  • 29
  • 54
5
votes
1 answer

WMI .NET Invalid query

I keep getting an "Invalid Query" exception when trying to execute the following query: ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskQuota WHERE QuotaVolume.DeviceID = 'C:'"); ManagementObjectCollection…
Vladimir M.
  • 1,049
  • 1
  • 10
  • 24
5
votes
3 answers

WQL does not support TOP - need workaround

WQL (basically SQL for WMI) does not support a TOP or LIMIT keyword. Sql Server used TOP and many other RDBMSs supprt LIMIT etc. Is there a workaround to emulating a SELECT query to behave as though it had a TOP/LIMIT clause that limits the result…
Paul Sasik
  • 79,492
  • 20
  • 149
  • 189
5
votes
2 answers

Does anyone have a WQL Query for finding the Edition of a SQL Server Instance?

Does anyone know how to use WMI to get the Edition of an SQL Server installation (do not care about the version) in VBScript? I have tried using the registry (but that requires you to know the instance name and the version of the SQL Server. I have…
QuietLeni
  • 139
  • 1
  • 3
  • 12
4
votes
2 answers

Get Bluetooth COM Ports

I am trying to access specific information about Bluetooth serial ports. I was able to find this window in my Bluetooth settings that showed me the port, direction, and name of a Bluetooth device if it was related to a COM Port. Currently to try…
Dan
  • 7,286
  • 6
  • 49
  • 114
4
votes
2 answers

Run WQL query by powershell

I want to know how to run WQL query with powershell. Here is the WQL query Select UAR.User, UAR.Application, UAR.CurrentState from sms_fullcollectionmembership as FCM INNER JOIN SMS_UserApplicationRequest as UAR ON UAR.User=FCM.SMSID where…
Roxx
  • 3,738
  • 20
  • 92
  • 155
4
votes
2 answers

WQL in filter doesn't work

I'm trying to do something like: Get-WmiObject Win32_NetworkAdapterConfiguration ` -Filter "DefaultIPGateway!=NULL" But I have an error: Get-WmiObject : Invalid query At line:1 char:14 + Get-WmiObject <<<< …
Alesia
  • 49
  • 1
  • 4
1
2 3
13 14