I thought I had tried the subselect and it did not work, but I tried it just now and it does. I think I was looking at the numbers as the subselect returns 1957 when it should return 1931, but I just compared the collection to OU and none of those systems are in the subselect. Thanks to all that responded and I’ll keep Garth’s links for reference.
From: [email protected] [mailto:[email protected]] On Behalf Of Garth Jones Sent: Wednesday, October 15, 2014 3:15 PM To: [email protected] Subject: [mssms] RE: Query for Systems Not in a Certain OU You will need a subselect query. These blog post will help you. http://be.enhansoft.com/post/2014/09/17/The-Subselect-Query.aspx http://be.enhansoft.com/post/2014/09/24/Subselect-Query-for-SCCM-Queries-or-Collections-(WQL).aspx From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Gushue, William Sent: Wednesday, October 15, 2014 2:57 PM To: myITforum SMS List ([email protected]<mailto:[email protected]>) Subject: [mssms] Query for Systems Not in a Certain OU I am trying to write a query which returns all systems that are not in a certain OU, but those systems still get returned. This query works and returns the 32 items it should: select * from SMS_R_System where SMS_R_System.SystemOUName = "<OUName>" This query returns 1963 items, but includes the 32 that I don’t want: select * from SMS_R_System where SMS_R_System.SystemOUName != "OHHLLP.COM/IS/COMPUTERS" Is this query even possible? Thanks. ________________________________ ******************************************************************** This e-mail message is privileged, confidential and subject to copyright. Any unauthorized use or disclosure is prohibited. Le contenu du présent courriel est privilégié, confidentiel et soumis à des droits d'auteur. Il est interdit de l'utiliser ou de le divulguer sans autorisation. ********************************************************************

