myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


query delima?? (#2 where are you)

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> query delima?? (#2 where are you) Page: [1]
Login
Message << Older Topic   Newer Topic >>
query delima?? (#2 where are you) - 11/20/2008 11:31:06 AM   
shadster

 

Posts: 35
Score: 0
Joined: 8/6/2008
Status: offline
In SMS2003 I have the following query (tied to a collection) works great but returns a too many results as i want to omit a couple of Sub-OU's that do not require this particular package...
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 (SystemOUName = "CMH.Domain.com/CMHWorkstations" AND SMS_G_System_COMPUTER_SYSTEM.Model != "OptiPlex GX260")

so in trying to narrow down this collection to certian OU's... this one returns Zero 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 
INNER JOIN SMS_G_System_COMPUTER_SYSTEM 
  ON SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId 
WHERE ((SystemOUName like "CMH.Domain.com/CMHWorkstations/AMCC*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Charter*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Contracts*" OR
SystemOUName like "CMH.Domain.com/CMHWorkstations/Corporate*" OR
SystemOUName like "CMH.Domain.com/CMHWorkstations/Corporate Training*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/ERP*" OR
SystemOUName like "CMH.Domain.com/CMHWorkstations/Finance*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Flight Center*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Flight Operations*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Logistics*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Maintenance*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/People Department*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Project 2007*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Projector PCs*" OR
SystemOUName like "CMH.Domain.com/CMHWorkstations/Remote HOme Users*" OR
SystemOUName like "CMH.Domain.com/CMHWorkstations/RemoteSites*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Sales & Marketing*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Security*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Shared Business Services*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/TEB*" OR 
SystemOUName like "CMH.Domain.com/CMHWorkstations/Technology Services*" OR
SystemOUName like "CMH.Domain.com/CMHWorkstations/Travel Department*")
AND SMS_G_System_COMPUTER_SYSTEM.Model != "OptiPlex GX260")

arghh   is my thinking off or logic screwy, or what am i missing?
Thanks in advance as this one has got me
Shadster

< Message edited by shadster -- 11/20/2008 11:48:55 AM >
Post #: 1
RE: query delima?? (#2 where are you) - 11/20/2008 11:40:56 AM   
shadster

 

Posts: 35
Score: 0
Joined: 8/6/2008
Status: offline
well... i changed *'s  to %'s  and it is now pulling results yippie

(in reply to shadster)
Post #: 2
RE: query delima?? (#2 where are you) - 11/20/2008 11:41:22 AM   
mreavis


Posts: 783
Score: 77
Joined: 9/10/2002
From: Olathe, Kansas
Status: offline
#1 item is the wildcard. user % instead of *. * is only for single character. Have you tried it with just 1 of your OU statements before you create the entire string?

_____________________________

Michael Reavis
SMS Admin
MCSE, MCDBA, MCDST
Johnson County Goverment

(in reply to shadster)
Post #: 3
RE: query delima?? (#2 where are you) - 11/20/2008 11:51:05 AM   
shadster

 

Posts: 35
Score: 0
Joined: 8/6/2008
Status: offline
Thanks Michael... yep it was a bone headded mistake... one of those where i was starting to pull my hair out (what is left of it anyway) and it ended up being someting small... well i guess i learned something today :-)  

Thanks Again!!!

Shadster

(in reply to mreavis)
Post #: 4
Page:   [1]
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> query delima?? (#2 where are you) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.297