/build/static/layout/Breadcrumb_cap_w.png

WMI script to create a collection based on software ID

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

Answers (3)

Posted by: Ifan 10 years ago
Second Degree Green Belt
2

http://www.snowland.se/2010/03/10/sccm-module-for-powershell/

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 12.0.0.0, 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 != "12.0.0.0")
 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

Posted by: bretthexum 10 years ago
Yellow Belt
1

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.

http://blogs.catapultsystems.com/mvrabel/archive/2013/05/08/sccm-2012-sub-select-collections-%E2%80%93-getting-everyone-who-%E2%80%9Cdoesnt%E2%80%9D-have-java-7-cu13.aspx


Comments:
Posted by: ClaudiuP 10 years ago
Third Degree Blue Belt
0

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


Comments:
  • No problem :) - Ifan 10 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ