locked
OU and WorkStation based Device Collection RRS feed

  • Question

  • Hi,

    I have to create one device collection based on OU that i can do through sample WQL ..

    but from that OU i want only Workstations only not Servers how can i got this ..

    should i create another membership rule for same device collection and use WQL but what would be the valuse for that is %workstation% , if am not wrong ??


    Shailendra Dev

    Thursday, February 26, 2015 4:03 PM

Answers

  • Maybe something like this:

    select * from SMS_R_System where SMS_R_System.SystemOUName="DOMAIN/OU" AND SMS_R_System.OperatingSystemNameandVersion like "%workstation%"

    Jeff

    Thursday, February 26, 2015 4:21 PM
  • I always create an all workstations 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 inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SYSTEM.SystemRole = 'Workstation'
    You could just limit your normal OU query to the All Workstations collection.

    Thursday, February 26, 2015 6:30 PM
  • You could do it a couple of ways..

    I use:

    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.OperatingSystemNameandVersion like "Microsoft Windows NT Workstation%"

    To get only workstations. That query will not pick up servers. One query should be enough...just have the query for the OU AND the query for the workstations.

    Thursday, February 26, 2015 4:23 PM

All replies

  • Maybe something like this:

    select * from SMS_R_System where SMS_R_System.SystemOUName="DOMAIN/OU" AND SMS_R_System.OperatingSystemNameandVersion like "%workstation%"

    Jeff

    Thursday, February 26, 2015 4:21 PM
  • You could do it a couple of ways..

    I use:

    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.OperatingSystemNameandVersion like "Microsoft Windows NT Workstation%"

    To get only workstations. That query will not pick up servers. One query should be enough...just have the query for the OU AND the query for the workstations.

    Thursday, February 26, 2015 4:23 PM
  • I always create an all workstations 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 inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SYSTEM.SystemRole = 'Workstation'
    You could just limit your normal OU query to the All Workstations collection.

    Thursday, February 26, 2015 6:30 PM
  • I just found the difference between this query and the other proposal. This query only seems to return machines who have the SCCM client fully installed. The other query (looking for the OperatingSystemNameAndType) picks up systems without installed SCCM clients as well. It probably uses AD System Discovery to get this info, whereas the SCCM client itself populates the other attribute after doing a full inventory.

    So, I guess it depends on what you want to use this collection for. I'm in the process of building out our base set of SCCM collections and ran into this difference. Hope it's helpful to someone!

    Monday, July 6, 2015 8:10 PM