locked
Exclude PCs from a collection RRS feed

  • Question

  • I have a software that I need to advertise to collection 'A'.  I need to exclude PC names 'comp1' and 'comp2' from collection 'A'.  Can someone help me with such query.  I have tried this, but I get a invalid syntax:


    SELECT * FROM SMS_R_SYSTEM where SMS_G_System_COMPUTER_SYSTEM.Name not in ( "comp1", "comp2" )

     

    Monday, November 8, 2010 10:14 PM

Answers

  • If you are creating collection Via Query based Rule,you can select the criterian Type as List of Values

    and Operator as Not in with multiple computer values.

    here is the query to exclude the computers:

    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.NetbiosName not in ("comp1","comp2")


    //Eswar Koneti @ http://eskonr.wordpress.com/
    Tuesday, November 9, 2010 12:00 PM

All replies

  • Add the one you want to exclude in a collection and use something like this:

    select SMS_R_System.ResourceId, SMS_R_System.Name, SMS_G_System_OPERATING_SYSTEM.Caption, SMS_G_System_OPERATING_SYSTEM.CSDVersion from  SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Caption = “Microsoft Windows XP Professional” and SMS_R_System.ResourceId not in (select ResourceID from SMS_CM_RES_COLL_XXX)

    where XXXX is the collection ID.

    OHM
    www.moe.am

    Monday, November 8, 2010 11:10 PM
  • If you are creating collection Via Query based Rule,you can select the criterian Type as List of Values

    and Operator as Not in with multiple computer values.

    here is the query to exclude the computers:

    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.NetbiosName not in ("comp1","comp2")


    //Eswar Koneti @ http://eskonr.wordpress.com/
    Tuesday, November 9, 2010 12:00 PM