collectionssccmsystem-centersccm-2007

SCCM 2007 collection Query, not approved machines with particular site code


I am trying to have a sccm 2007 collection query which can populate "not approved" and assigned to site code "AA1" - machines. Any suggestions ?


Solution

  • You can find things like this by googling 'SCCM Collection Query' and then describe what you're looking for.

    Here's how to do your particular task:

    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 inner join SMS_CM_RES_COLL_SMS00001 on
    SMS_CM_RES_COLL_SMS00001.ResourceId = SMS_R_System.ResourceId
    where SMS_CM_RES_COLL_SMS00001.IsApproved= ‘0‘ and SMS_R_System.SMSInstalledSites = "XYZ"
    

    The juciest bits are in the last two lines, while the remainder in the beginning is kind of just SCCM WQL Cruft:

    where SMS_CM_RES_COLL_SMS00001.IsApproved= ‘0‘ and SMS_R_System.SMSInstalledSites = "XYZ"