Query - Computers with specific application and version installed
Sometimes you want to create a query based on if a computer has a specific Application and version number. This type of collection is great for bushing out an update to application.
In the example code I am using Adobe Acrobat version 9. To find a different application in your own query find the line in the code
SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Adobe Acrobat%"
and change "Adobe Acrobat%" to the application you want. Remember you can use % in the beginning or the end of a statement to work like a variable. Next is the version number, in the example code the line
SMS_G_System_ADD_REMOVE_PROGRAMS.Version >= "9%"
The "9%" is the version, you can change this to anything that shows in the version column of add and remove programs.
In the example code I am using Adobe Acrobat version 9. To find a different application in your own query find the line in the code
SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Adobe Acrobat%"
and change "Adobe Acrobat%" to the application you want. Remember you can use % in the beginning or the end of a statement to work like a variable. Next is the version number, in the example code the line
SMS_G_System_ADD_REMOVE_PROGRAMS.Version >= "9%"
The "9%" is the version, you can change this to anything that shows in the version column of add and remove programs.
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 where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Adobe Acrobat%" and SMS_G_System_ADD_REMOVE_PROGRAMS.Version >= "9%"
Perfect!
ReplyDeleteVery thougghtful blog
ReplyDeleteThanks for sharring this
ReplyDelete