Windows Scripting
  Home arrow Windows Scripting arrow Introduction to WQL: SQL for WMI
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Introduction to WQL: SQL for WMI
By: Nilpo/Developer Shed Staff Writer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2007-05-16

    Table of Contents:
  • Introduction to WQL: SQL for WMI
  • Data Queries
  • Event Queries
  • Schema Queries

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Introduction to WQL: SQL for WMI


    (Page 1 of 4 )

    According to Microsoft’s MSDN, the WMI Query Language (WQL) is a subset of the American National Standards Institute Structured Query Language (ANSI SQL) with minor semantic changes. Queries built using WQL are used to control the WMI Service.

    Those familiar with SQL will find making the adjustment to WQL very simple.  Those new to it will probably find it a bit tough to learn in the beginning.  Once you start getting a handle on the query logic and the command structure, it should become dramatically easier.

    It’s important to have some understanding of how WMI works.  It’s also difficult to give a clear-cut definition. Try to think of WMI as a repository of properties and methods related to the system environment that you will access like a database.

    While WMI’s intended purpose was to provide access to system hardware, it has since been expanded to cover network protocols, the Windows registry, and much more.  And it can be further expanded by adding additional Providers.

    Providers are groups of WMI Classes that are designed to perform specific or similar tasks.  They consist of the necessary code (methods involved in retrieving and setting data) and a schema (a document describing the type of information being returned).

    Think of Providers as individual databases within your WMI repository.  While you’ll learn an exclusion later (Associators), for the most part, you cannot move between Providers.  You must make a unique query for each one you need. (In WSH, this means instantiating separate objects for each of them).

    Individual groups of related methods and properties are contained within WMI Classes. Think of Classes as the tables within your imaginary database. They contain groups of properties and methods that can be polled and manipulated like data fields.

    The topics in this article are very broad. I don’t have any way to cover them thoroughly. My aim is to provide you with a starting place to work from. There have been a number of excellent books written on the subjects of WMI and SQL should you want more information.

    There are three types of WQL queries supported by WMI.  We’re going to take a look at each of them now.  I’m also going to show you an example of each.  Don’t worry if you don’t fully understand the syntax.

    More Windows Scripting Articles
    More By Nilpo/Developer Shed Staff Writer


       · In order to harness the power of WMI in your scripts, you'll need to be able to...
     

    WINDOWS SCRIPTING ARTICLES

    - Generating Outlook Signatures Based on Activ...
    - VBScript: Converting and Formatting with Fun...
    - VBScript: Conversion and Format Functions
    - VBScript: Array Functions
    - VBScript: Strings, You Can`t Function withou...
    - VBScript: More String Functions
    - VBScript: Functioning with Strings
    - Working with the Windows Registry in C++
    - Understanding Objects
    - HTML Applications: Giving WSH a User Interfa...
    - Modifying Computer Objects with Active Direc...
    - Logon Script to Send Email Notifications
    - Securing Computers and Active Directory
    - Moving and Renaming Computers with Active Di...
    - Working with System Processes in WSH





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway