Showing posts with label WQL queries. Show all posts
Showing posts with label WQL queries. Show all posts

Friday, November 8, 2013

Using SCCM Queries - step by step document

Here is an Excellent Document I found on the Internet shared by questnet.edu which details on how to use the 'Queries' feature in SCCM Console.

https://www.questnet.edu.au/download/attachments/20873328/Using+MS+SCCM+Queries.pdf

Queries are run against SCCM site's database and retrieve specific data according to the criteria of the query. SMS provides many predefined queries, and if required, we can create additional queries.

Query-based collections are dynamic objects. If a resource no longer meets the collection's query, it is automatically removed from the collection. And if a resource that originally did not meet the collection's query has changed in a way that it now meets the collection's query, it is automatically added to the collection. This behavior greatly reduces and simplifies the administrative work of managing the clients.

Friday, September 27, 2013

WQL Query to add bulk computers to SCCM collection

We use WQL queries to create dynamic SCCM Collections to list machines with a particular software, hardware, etc. But when it comes to adding a random machines from a given list and when we don’t use the SCCM Right-click tools, mostly we go the conventional manual method. Once during a conversation with a Microsoft tech, he helped me with this simple query which made most of my deployments easier. I can say this is faster and lighter than using Right-click tools. Sharing this query here.

We can add any number of Computer list to a Collection, but max 1500 hostnames per query. We can also remove any single machine from this customized collection.  

Select SMS_R_System.ResourceID,SMS_R_System.ResourceType,
SMS_R_System.Name,SMS_R_System.SMSUniqueIdentifier,
SMS_R_System.ResourceDomainORWorkgroup,SMS_R_System.Client 
from SMS_R_System where SMS_R_System.name in
('Machine1','Machine2','Machine3')

Easy Steps to consolidate the computer list into the query with comma: 
* Add the machines to MS Excel by listing each machine on each row.
* Include a column (A) before machines list with the single code symbol  (').
* On the Columns C and D enter the comma symbol (,) and single code ('). 
* Drag the single code and comma symbols till the last before row of the machine list.
* Add a formula to Column E [=A:A&B:B&C:C&D:D].
* On Column E, Copy - Paste Special with Values.
* Copy the entire column E and paste in the query between brackets ( )
* It should look like  ('Machine1',

                               'Machine2',
                               'Machine3',
                               'Machine4')

* Click Ok and close the New collection window and we are done.

Tuesday, June 25, 2013

Run Command to open SCCM client 'Configuration Manager Properties'

I had always checked online to find a Run command to open the 'Configuration Manager Properties' window from a SCCM client machine's Control Panel. Most of the time i had to create a shortcut of the Configuration Manager Properties window on the desktop for easy access.

Recently i found a post by Chris Nackers who has successfully achieved in getting the command line (which i hope is not available from Microsoft site itself). Thanks Chris for sharing the info.

Start - Run -control smscfgrc

Update to the above post:
  • This command works for SCCM 2007 and SCCM 2012 clients. I haven't checked on SMS2003. 
  • And it works pretty fine on Windows 7/8/2003/2008/2012 as well as Server Core operating systems.


Ref.: http://social.technet.microsoft.com/Forums/en-US/configmgrgeneral/thread/7b8b8e2a-0756-4be5-add0-a0a3f0808c7a/

Monday, March 14, 2011

Difference between WQL and SQL in SCCM

Below are few points which make difference between WQL and SQL :
  1. WMI provides its own query language that allows you to query managed objects as data providers
  2. WMI Query Language (WQL) is essentially a subset of SQL (Structured Query Language) with minor semantic changes.
  3. Unlike SQL, WQL does not provide statements for inserting, deleting, or updating data and does not support stored procedures.
  4. WQL does have extensions that support WMI events and other features specific to WMI. WQL is the basis for Configuration Manager queries, whereas SQL is used for ConfigMgr reports.
  5. One important advantage of WQL is that a WQL query can return WMI objects as well as specific properties.
  6. Because management applications such as the Configuration Manager console interact with WMI objects, WQL queries can return result sets that you can use within the ConfigMgr infrastructure.
Eg: Configuration Manager collections are based on WQL queries.

Ref: http://systemcentersupport.blogspot.com/2010/01/what-is-wmi-query-langauge-or-wql.html