Sccm Collection Query With Not Value In Them
Hello , im having a collection of all windows xp systems with this query : " 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 '%Workstation 5.1% " this if actually great , but i do have something like 4 workstations in there that i want to get out from there (workstations of high rank people and that kind of things) , how can i add a "NOT" value or query to this collection properties , i dont want to delete them from the collection i think that in time they will popup back again.. is there a simple solution for this? thanks :)'
February 10th, 2011 6:23am

het thanks..but i get systax errors on this one.. this is my original query 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 5.1%" if i add and SMS_R_System.Name not in ("hostname1", "hostname2","hostname3") it dont work , maybe the table is SMS_G_System and not R? im really a newbee with sql :)
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2011 6:43am

Sorry my mistake its working!! thank you!
February 10th, 2011 6:47am

Hello - I would suggest you to create a new collection add the computers which you want to exclude into that collection and then update the your query with below line. and ResourceId not in (Select ResourceID FROM SMS_FullCollectionMembership WHERE CollectionID = 'collection ID')Anoop C Nair
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2011 6:48am

You can do it by using list of values criterian .Create a new collection by adding above query and append the following to it: and SMS_R_System.Name not in ("hostname1", "hostname2","hostname3"). it should look like this: 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 '%Workstation 5.1% and SMS_R_System.Name not in ("hostname1", "hostname2","hostname3") //Eswar Koneti @ www.eskonr.com
February 10th, 2011 7:05am

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

Other recent topics Other recent topics