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
1 answer

Listing windows user accounts using C#

I have to list all users (both local system and domain). I tried using WQL but it takes a lot of time for the program to run. Is there any other way to get it from registry? Any help would be appreciated.
Prabhu
  • 3,434
  • 8
  • 40
  • 48
1
vote
1 answer

vbscript for WQL WMI with or operator

i am querying for event viewer log using vbscript. When I try ot use OR operator @ Where Logfile='System' Or 'Application' it gives info but drops TYPE condition and i found my results with information type data. How do i combine this two queries…
msinfo
  • 1,147
  • 6
  • 21
  • 39
1
vote
1 answer

Random value for disk Signature

As part of a machine identification system, I'm looking for the Signature of the Win32_DiskDrive. On two customer's machines now, I've seen this field have a random value. I assume that is due to not having checked the HRESULT in the shipped…
Thomas
  • 3,348
  • 4
  • 35
  • 49
1
vote
1 answer

Returning mounted drives on server in WQL

I am trying create a simple WQL query where I only return mounted drives on a server. These are drives that do not have a drive letter associated with them. I tried the following sytnax and it does not return a result set: SELECT * FROM…
Michael Kniskern
  • 24,792
  • 68
  • 164
  • 231
1
vote
1 answer

WQL to find files in a directory

How do you find files inside directories with WMI Query Language? This is what I have so far: select * from Cim_DataFile where path = "\\\\C:\\Users\\name\\" The query returns no results. Any help is much appreciated.
CodeKingPlusPlus
  • 15,383
  • 51
  • 135
  • 216
1
vote
1 answer

WQL syntax: DiskDriveToDiskPartition with a LIKE operator

So I'm trying to match up physical drives to partitions to drive letters, and DiskDriveToDiskPartition seems like a good candidate for doing that, but I'm struggling to get the query to work like I want it to: I've used the WMI Query Builder to…
David M
  • 2,763
  • 4
  • 21
  • 24
0
votes
2 answers

How to filter Win32_UserAccount results by OU

In PowerShell, I already know how to use DirectoryEntry and DirectorySearcher to get a list of users in a certain OU. The results of this method are mostly what I am looking for in AD, but it seems easier to get the same information by using a WMI…
Bratch
  • 4,103
  • 5
  • 27
  • 32
0
votes
1 answer

How do I find out what objects I can query with WQL?

I want to use WQL to get information about IIS worker processes, plus just about everything in Resource Manager -- disk usage, memory usage, CPU usage, and network usage. Where can I find a list of all the object names so I can write my…
Jesse
  • 187
  • 1
  • 2
  • 9
0
votes
0 answers

Check for yellow bangs in Device Manager

I need to find the number of devices (on Windows 11) with yellow bangs. I found this WQL query: SELECT * FROM Win32_PnPEntity WHERE ConfigManagerErrorCode <> 0 I implemented this in Python. It does return devices with bangs, but it also returns…
entheo6
  • 1
  • 2
0
votes
0 answers

WMI Permanent Extrinsic Event binding not triggering

I'm pretty unfamiliar with WMI so I made some test MOFs for a permanent extrinsic event. My filter to consumer binding isn't working correctly. Here are the MOFs pulled directly from wbemtest. Filter: instance of __EventFilter { CreatorSID = { […
Pulpo
  • 224
  • 2
  • 12
0
votes
0 answers

WQL query to find devices with multiple users

The query I am trying so far: select SMS_G_System_COMPUTER_SYSTEM.Name, SMS_G_System_COMPUTER_SYSTEM.Model, SMS_R_System.OperatingSystemNameandVersion, SMS_R_System.Build, SMS_R_User.UniqueUserName from SMS_R_System inner join…
Bisclavret
  • 1,327
  • 9
  • 37
  • 65
0
votes
1 answer

Simple WQL query issue

The full query: select SMS_G_System_COMPUTER_SYSTEM.Name, SMS_G_System_COMPUTER_SYSTEM.Model, SMS_R_System.OperatingSystemNameandVersion, SMS_R_System.Build, SMS_R_User.UniqueUserName from SMS_R_System inner join…
Bisclavret
  • 1,327
  • 9
  • 37
  • 65
0
votes
0 answers

Filter with Username in Win32_Process WQL Query

I want to ask any way can direct filter username in win32_Process WQL Query? If use looping with use GetOwner method is use much time to wait if too many user open same exe. currently the query is Select * from win32_Process where name =…
Tom96
  • 1
  • 1
0
votes
0 answers

How to setup a permanent WMI subscription which includes a dynamic condition?

I want to create a permanent WMI subscription to start a script every time a defined trigger gets fired. Here I would like to react when the Citrix RTT is above a given threshold. Here a regular PS-code sample to get that RTT data (with a filter in…
Carsten
  • 1,612
  • 14
  • 21
0
votes
1 answer

How does logging in interactively to a Windows host effect WMI queries to that host?

I have an application that performs WMI queries on remote hosts. I'm attempting to define the minimal amount of security permissions required for the user used to do the queries. I've defined a user with minimal permissions. I've found that this…
David Resnick
  • 4,891
  • 5
  • 38
  • 42