I have a lot of old sofware on over 500 servers. I know there is a way to create a collection using WMI queries, but I a noobie at scripting. 

I have the Software ID (from SCCM reporting) of the specific software. I am looking to find out all the servers that have Software ID XXXXX-XX-XXX-XX installed on 'All Windows Server Systems' Collection and put them in another collection.


0 Comments   [ + ] Show Comments


Please log in to comment

Community Chosen Answer



This powershell module does all the WMI for you.

For the query, use a subselect, but instead of using two collections, which is messy, use the query below for a single collection. It does the following:

All computers with *firefox* that isn't version, that has a OS named %Workstation% and is in the OU Computers and has the SCCM Client installed.

 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 SMS_R_System.ResourceId in
 (select SMS_R_System.ResourceId 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 "%Firefox%" and SMS_G_System_ADD_REMOVE_PROGRAMS.Version != "")
 and SMS_R_System.OperatingSystemNameandVersion like "%workstation%"
 and SMS_R_System.SystemOUName like "DOMAIN.int/Computers"
 and SMS_R_System.Client = 1

This only works for 32bit software. If you want 64bit you need to use SMS_G_System_ADD_REMOVE_PROGRAMS_64 instead. If you want to do it on GUID use SMS_G_System_ADD_REMOVE_PROGRAMS.ProdID

Answered 05/15/2013 by: Ifan
Second Degree Green Belt

Please log in to comment



Is this what you are looking for?  A SCCM subselect query?  (At least the first part of the article) .  In that example it's looking for displayname which you could also use.


Answered 05/14/2013 by: bretthexum
Yellow Belt

  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
Please log in to comment

Thanks Ifan and bretthexum!
This is exactly what I need. I'll give it a try and hope that it works.

Answered 05/15/2013 by: ClaudiuP
Third Degree Blue Belt

  • No problem :)
Please log in to comment
Answer this question or Comment on this question for clarity