Collection with SQL query to only return workstations (not servers) pending reboots...
I found a great sql query in another post regarding how to create a collection that finds computers pending a reboot. The problem is that it looks for both workstations and servers but I need to only target workstations. Here is the sql statement to find computers to query for pending reboot- 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 AS sms_r_system inner join SMS_UpdateComplianceStatus as c on c.machineid=sms_r_system.resourceid where c.LastEnforcementMessageID = 9 Here is the sql statement to find workstations only- 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 OperatingSystemNameAndVersion like 'Microsoft Windows NT%Workstation%' What I need is to be able to join them so it will only return workstations pending reboot. Any ideas? Thanks!
January 15th, 2011 7:03am

I think I figured this out. The query looks like the following now: 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 AS sms_r_system inner join SMS_UpdateComplianceStatus as c on c.machineid=sms_r_system.resourceid where c.LastEnforcementMessageID = 9 and OperatingSystemNameAndVersion like 'Microsoft Windows NT%Workstation%' I just added the above bold section. Can any SQL experts confirm this would return ONLY workstations that are pending reboot? Thanks again!
Free Windows Admin Tool Kit Click here and download it now
January 15th, 2011 7:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics