0

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

1 Answers1

1

My understanding is that SCCM did not extend WQL, but rather put the functionality to implement joins and distinct sets in SMSProv.dll. See these links for SCCM:

While there is no JOIN in WQL, there is an ASSOCIATORS OF query. You can run this query directly in wbemtest.exe:

ASSOCIATORS OF {Win32_LogicalDisk.DeviceID="C:"}

However, if you are seeking to write your own programs to query WMI, you would not want to ride on the back of SMSProv.dll, which could change out from under you. You might want to look at Powershell. Here is a link to a blog post showing how to do it:

Three Easy Ways to Use PowerShell and WQL to Get WMI Data

S. Rojak
  • 454
  • 2
  • 6
  • I need to request WMI data with an addin of my application to synchronize data in my database. This take the scope, the query and the data to synchronize as configuration. It work fine for simple query but for more complex query I need support JOIN, DISTINCT, WHEN ... or I must manipulate data in the addin, but i did not want do a specific addin. Is SMSProv.dll must be deployed on the remote computer that is the target of the WMI query? – Troopers Jan 26 '16 at 07:57
  • Given your purpose, I recommend not using SMSProv.dll for the reason previously stated. – S. Rojak Jan 26 '16 at 14:41