Collection Query help
I need to create collections for systems that do and also don't have the following installed and wondered if anyone had queries for them already that they could paste up here:
Office 2010
Adobe Reader X
Javan Runtime 6 Update 25
Project 2010
Visio 2010
Thanks in advance.
June 27th, 2012 6:51am
For the PCs without each piece of software you will need a subselect, these two blog post will help you write it.
http://smsug.ca/blogs/garth_jones/archive/2007/05/10/wql-subset-query.aspx
http://smsug.ca/blogs/garth_jones/archive/2007/05/08/subset-query.aspxhttp://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2012 7:07am
Thanks Garth. As these machines will all be new systems running windows 7 and a mixture of x86 and x64, how do I amend your scripts to add in additional commands for x64 versions?
June 28th, 2012 5:23am
You would need to do two subselects, one on the x86 data and one on the x64 data.
This is a representation of what the where section of your query would look like.
Where resource not in (select resourceid from X86 class where name = Visio) and resource not in (select resourceid from X64 class where name = Visio)
http://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
June 28th, 2012 7:53am
I get an error stating that my query is ot valid, any ideas what's wrong with the below:
select distinct SMS_G_System_COMPUTER_SYSTEM.Name from SMS_G_System_COMPUTER_SYSTEM where SMS_G_System_COMPUTER_SYSTEM.ResourceID not in (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_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId = SMS_R_System.ResourceId inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId
where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Adobe Reader X%" or SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like "Adobe Reader X%")
June 28th, 2012 10:26am
You need two subselect queries not one.
Your subselect can only have 1 column within the results
Something like this. (edited freehand, untested)
select distinct
SMS_G_System_COMPUTER_SYSTEM.Name
from
SMS_G_System_COMPUTER_SYSTEM
where
SMS_G_System_COMPUTER_SYSTEM.ResourceID not in
(select
SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID
from
SMS_G_System_ADD_REMOVE_PROGRAMS
where
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Adobe Reader X%" )
and
SMS_G_System_COMPUTER_SYSTEM.ResourceID not in
(select
SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceID
from
SMS_G_System_ADD_REMOVE_PROGRAMS_64
where
SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like "Adobe Reader X%")
http://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
June 28th, 2012 10:53am
sorry, I don't know WQL and pasting the above says it's not a valid query.
June 29th, 2012 5:22am
sorry, I don't know WQL and pasting the above says it's not a valid query.
I cut and pasted the query above and it works works without issue.http://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
June 29th, 2012 6:40am