SCCM Device Collections with Workgroup Servers or Workstations

For all Workgroup Windows Servers and workstation I used this queries below, the key thing is I queried the variable found in the resource Explorer Domain Role and Operating system Name & version %server% or %Workstation%.

The domain Role attribute class value classifies the status of the devices there are 5 classes please see list below.

Computer System – Domain Role

0              Standalone Workstation

1              Member Workstation

2              Standalone Server

3              Member Server

4              Backup Domain Controller

5              Primary Domain Controller

I have used SMS_G_System_COMPUTER_SYSTEM.DomainRole. The attribute class is Computer System and the attribute is Domain Role for Workgroup devices are Standalone Server but I also used SMS_R_System.OperatingSystemNameandVersion like to isolate the collection type with a %server% or %workstation% wildcard.

Capture

All Workgroup Windows Servers (Works)

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_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like “%Server%” and SMS_G_System_COMPUTER_SYSTEM.DomainRole in (2)

All Workgroup Windows Workstation (Works)

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_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like “%workstation%” and SMS_G_System_COMPUTER_SYSTEM.DomainRole in (2)