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:


  


Collection based on NOT having file, with version

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

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Collection based on NOT having file, with version Page: [1]
Login
Message << Older Topic   Newer Topic >>
Collection based on NOT having file, with version - 9/25/2008 10:22:10 AM   
joemonkey

 

Posts: 202
Score: 2
Joined: 2/28/2007
From: Kentucky
Status: offline
I've been banging my head over this and every time I think I have it I get the message that I have entered an incorrect query..  I know I need a subselect query, but I simply cannot get it to work properly.  I want to create a collection that contains computers that have a specific file where the file version is less than version 8%.  Is this even possible?
Post #: 1
RE: Collection based on NOT having file, with version - 9/25/2008 11:05:39 AM   
skissinger


Posts: 2114
Score: 134
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
When I'm trying to figure out a complex collection query, I start small.  In the queries section of the console, I'd start by first getting all the computers with the file at all, and display the version, & the path.  Then I'd start tweaking it to be 'less than 8'.  Depending upon the # of versions you might have listed, you might want to use the "version is in" and a static list of the version numbers, instead of the less than.

Depending upon the file, it may appear in multiple locations on the client as well.  You might also need to limit it to "and file path is like".

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to joemonkey)
Post #: 2
RE: Collection based on NOT having file, with version - 9/25/2008 12:04:37 PM   
nivor

 

Posts: 21
Score: 0
Joined: 3/23/2007
Status: offline
This should work, obviously add the file name and version number:

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 ResourceId not in (select distinct SMS_G_System_SoftwareFile.ResourceID from  SMS_G_System_SoftwareFile where SMS_G_System_SoftwareFile.FileName = "FileNameHere" and SMS_G_System_SoftwareFile.FileVersion < "VersionNumberHere")

(in reply to joemonkey)
Post #: 3
RE: Collection based on NOT having file, with version - 9/25/2008 12:30:07 PM  1 votes
jnelson993


Posts: 899
Score: 127
Joined: 2/18/2005
From: Minneapolis, MN
Status: offline
Actually, that won't work as expected. SQL and WQL are going to use a letter-by-letter dictionary sort so version 8 is going to be GREATER than version 11 because the character 8 comes AFTER character 1 in the dictionary.  You'll likely have to use a LIKE statement and the bracket wildcard [] operator to catch all the versions from 0-7.  And you don't need a subselect, because you're looking for computers that HAVE the file where it's less than version 8.%.  So, something like this perhaps:

SELECT
  sys.ResourceID,
  sys.ResourceType,
  sys.Name,
  sys.SMSUniqueIdentifier,
  sys.ResourceDomainORWorkgroup,
  sys.Client
FROM  
  SMS_R_System AS sys
  INNER JOIN SMS_G_System_SoftwareFile AS sf
     ON sys.resourceID = sf.resourceID
WHERE
  sf.FileName = "FileNameHere"
  AND sf.FileVersion LIKE "[0-7].%"


So, if the FileVersion starts with "0." through "7." , it will show up in the report...Make sense?
For completeness, let's quickly talk about wildcards...a wildcard character you're probably all familiar with is the % sign.  It basically means match 0 or more of any characters.  Then there's the underscore _ which means match any single character.  But there's also these brackets [ ] which let you specify a range (where [0-9] means a single character matching the number 0 through 9 or [a-g] means a single character matching any letter from a through g) or a set (where [135] means a single character matching a 1, 3 or 5 and [adf] means any single character matching a, d or f).  You can also put those brackets next to each other to specify multiple ranges (like [0-9][0-9] representing every number between 00 and 99].


_____________________________

Number2 (John Nelson)
MyITForum - Blog
MyITForum - Forum Posts

(in reply to nivor)
Post #: 4
RE: Collection based on NOT having file, with version - 9/25/2008 1:39:04 PM   
joemonkey

 

Posts: 202
Score: 2
Joined: 2/28/2007
From: Kentucky
Status: offline
thanks jnelson993, I didn't realize the sort would work like that, or that the bracket variable even existed.  Seems to be working fine now

(in reply to jnelson993)
Post #: 5
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Collection based on NOT having file, with version 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.375