Ask a questionAsk a question
 

AnswerOS discovery

  • Thursday, November 05, 2009 3:44 PMJepeto46 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    how do i do a query for all OS discovered? In other words, I know how to look for "Like %workstation 5.1%", but I want to build a query that will tell me what I do not know or aware of...
    In other words, build a collection that will list and combine all records, and if possible the count as well.
    Something like:

    windows server 2000
    windows server 2003
    Windows 98 (who knows :-0)?

    Thank you!
     

Answers

  • Friday, November 06, 2009 10:54 PMSherry KissingerMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    How to build a subselect query:  http://www.myitforum.com/articles/1/view.asp?id=179

    which is what you just asked "show me computers that don't have something".

    So I would approach it like this.  First, I would not build this in Collections.  This is a query, not a collection (if you need it later for a collection, you can grab the query later). 
    Basically, first create a query of "server 2008 that DO have DHCP service started/automatic"
    then, you would create a query of "server2008 which are Not in the first query"

    Follow Rod Trent's article to get your head wrapped around the concept; take it slow.  The first few times can be a bit confusing, but you'll be an subselect pro in no time.

    As to how; just look at existing queries, and/or start playing in the Query area of your console.
    Standardize. Simplify. Automate.

All Replies

  • Thursday, November 05, 2009 4:14 PMTorsten [MVP]MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    That would be the SQL version: select distinct caption0, version0 , count(version0) from v_GS_OPERATING_SYSTEM group by caption0, version0
  • Thursday, November 05, 2009 9:21 PMJepeto46 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Torsten

    Pardon my ignorance, however i am clueless in SQL free form.
    Is this something I need to build out of the values, since i get an invalid statement when using the statement above.
  • Thursday, November 05, 2009 9:57 PMGarth JonesMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Torsten's query is for reporting not a ConfigMgr queries.


    http://www.enhansoft.com/
  • Thursday, November 05, 2009 9:59 PMSherry KissingerMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Torsten's code was for a report, not a collection, nor for the "query" section.  The reason it has to be a report is because you asked for a Count.  In order to do counts of something, you need to use reporting.

    Create a new report, and paste in Torsten's code (replacing the code that's there by default in the bottom window).

    Oh, and because v_gs_operating_system comes from inventory, that'll only get you information on clients.  You used the word "OS discovered", so there is a mild distinction between "discovered" computers and computers that are sending up hardware inventory as clients.  If Torsten's report isn't quite what you meant, let us know.
    Standardize. Simplify. Automate.
  • Friday, November 06, 2009 2:01 AMJepeto46 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks guys, excellent clarification regarding reporting and counts.
    I would like to create a collection without a count that will list the OS discovered only as well.
    I will come back here if I need more help.
  • Friday, November 06, 2009 1:05 PMJohn MarcumMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks guys, excellent clarification regarding reporting and counts.
    I would like to create a collection without a count that will list the OS discovered only as well.
    I will come back here if I need more help.

    There are built in collections for most operating systems. If there's not one for the OS you need just copy a built-in one and change the OS version in the query.



    John Marcum | http://www.TrueSec.com/en/Training.htm | http://myitforum.com/cs2/blogs/jmarcum
  • Friday, November 06, 2009 4:47 PMJepeto46 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am finding most of what I need, however I winder if there is a book os source I can use to teach myself the SCCM related query language.
    As an example, I was able to find out which computers run a specific OS, but now i want to create a query to find out which of them do not have specific service running, for example 2008 servers all version with DHCP service NOT running. I obviuosly need to learn much more about the language.
    How?
  • Friday, November 06, 2009 10:54 PMSherry KissingerMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    How to build a subselect query:  http://www.myitforum.com/articles/1/view.asp?id=179

    which is what you just asked "show me computers that don't have something".

    So I would approach it like this.  First, I would not build this in Collections.  This is a query, not a collection (if you need it later for a collection, you can grab the query later). 
    Basically, first create a query of "server 2008 that DO have DHCP service started/automatic"
    then, you would create a query of "server2008 which are Not in the first query"

    Follow Rod Trent's article to get your head wrapped around the concept; take it slow.  The first few times can be a bit confusing, but you'll be an subselect pro in no time.

    As to how; just look at existing queries, and/or start playing in the Query area of your console.
    Standardize. Simplify. Automate.
  • Saturday, November 07, 2009 3:49 AMJepeto46 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks Sherry.

    Yes, the link you gave me was exactly it.
    I followed your advice, and started cloning queries than re-do them. learning bit by bit.
    BTW, I also like your BLOG.