The below query is designed to return all workstation in my environment minus the ones in an exclusion security group in AD and that have an active client. However they are still showing up in the collection. Is there a different way to exclude these machines?
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.SystemGroupName != "NA\\SCCM-Exclude" and (SMS_R_System.Client is not null and SMS_R_System.Client != 0)