Geoff Posted August 3, 2016 Posted August 3, 2016 I have the 64bit + 32bit Java MSI's setup as Applications in SCCM 2012 R2. These deploy to collections just fine. I have also got a Package that is basically a batch file that removes all the old java versions and java update check using msiexec commands and the installer id. This doesn't seem to be working at the moment. What I want to do is group these together logically and deploy them to a collection together, rather than in three separate operations. I'm a little unclear the best way to do this. Dependancies? or a Task Sqeuence?
free780 Posted August 3, 2016 Posted August 3, 2016 (edited) If you have the hardware inventory enabled. You should be able to find out which versions of Java are installed across your network. Then download each version add to sccm. On the latest version under supercedance add the old Java versions. Send the old versions to uninstall. When you deploy the new vwrsion. The older versions will be uninstalled. Edited August 3, 2016 by free780
Arthur Posted August 3, 2016 Posted August 3, 2016 I'm a little unclear the best way to do this. I use PSADT to do everything you have mentioned in a single SCCM application. I can post my script if you want?
Steve21 Posted August 3, 2016 Posted August 3, 2016 (edited) We do it just with a BAT which I know isn't as shiny but still works if you want another option, random example: Start /wait msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83218025F0} /qn /norestart Start /wait msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83218045F0} /qn /norestart Start /wait msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83218065F0} /qn /norestart msiexec /i jre1.8.0_73.msi JU=0 JAVAUPDATE=0 AUTOUPDATECHECK=0 RebootYesNo=No WEB_JAVA=1 /q Or a fuller option if you need to fix the old settings config files (If using the exe not msi) etc but only need it done once and not every update: Start /wait msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F03217060FF} /qn /norestart Start /wait msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83218025F0} /qn /norestart Start /wait msiexec.exe /x {26A24AE4-039D-4CA4-87B4-2F83218045F0} /qn /norestart MD C:\ProgramData\Oracle\Java COPY "%~dp0java.settings.cfg" "C:\ProgramData\Oracle\Java\java.settings.cfg" /Y "%~dp0jre-8u65-windows-i586.exe" INSTALL_SILENT=1 STATIC=0 AUTO_UPDATE=0 WEB_JAVA=1 WEB_ANALYTICS=0 EULA=0 REBOOT=0 reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v SunJavaUpdateSched /f reg add "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f Just put the old version IDs in depending what you have deployed etc. Steve Edited August 3, 2016 by Steve21
penfold Posted August 3, 2016 Posted August 3, 2016 When I tried this I seemed to have problems with the files being locked and there for the uninstall failed to complete. This was being done via SCCM and I couldn't see anywhere where it could be set to log off/Shutdown. It worked for some systems but now all.
free780 Posted August 3, 2016 Posted August 3, 2016 You can set to when it's logged off. Or set a requirement that Java.exe isn't a running process.
Arthur Posted August 4, 2016 Posted August 4, 2016 That would be massively helpful Here it is... https://db.tt/hVQQO6wQ Place the two Java MSIs inside the Files folder. Read the ReadMe.txt first though. If required, see pages 25-31 of the PSAppDeploymentToolkitAdminGuide (included in download above) on how to add the script to SCCM as an Application. The installation and uninstallation commands are: Deploy-Application.exe Install Deploy-Application.exe Uninstall When I deploy Java with SCCM I just set it to deploy while no one is logged on. 1
Geoff Posted August 5, 2016 Author Posted August 5, 2016 I had to tweak for JRE v8 u101 but otherwise it seems to of deployed ok on a clean Win 7 64bit machine. I need to test it on a 'messy'' machine and with Win 10 LTSB but it seems the best way of doing things. Thanks @Arthur
Geoff Posted October 26, 2016 Author Posted October 26, 2016 Updated for JRE8 v111 with no issue. I've also genereated some reports to keep an eye on things using report builder and email subscriptions. If you want to do this too you'll need an SQL query. Here's what I'm using: select distinct SMS_R_System.Name0 as 'Computer Name', SMS_R_System.AD_Site_Name0 as 'AD Site', SMS_R_System.SMS_Unique_Identifier0 as 'SMS ID', SMS_R_System.Resource_Domain_OR_Workgr0 as 'Domain', CASE When SMS_R_System.Client0 = 1 then 'Yes' else 'No' END as Client, __System_ADD_REMOVE_PROGRAMS0.DisplayName00 as 'Program Display Name', __System_ADD_REMOVE_PROGRAMS0.Version00 as 'Program Version' from vSMS_R_System AS SMS_R_System INNER JOIN Add_Remove_Programs_DATA AS __System_ADD_REMOVE_PROGRAMS0 ON __System_ADD_REMOVE_PROGRAMS0.MachineID = SMS_R_System.ItemKey where ( __System_ADD_REMOVE_PROGRAMS0.DisplayName00 like 'Java _ Update %' AND __System_ADD_REMOVE_PROGRAMS0.Version00 NOT IN ( select distinct top 1 Version00 from Add_Remove_Programs_DATA where DisplayName00 like 'Java _ Update %' order by Version00 desc ) ) union select distinct SMS_R_System.Name0 as 'Computer Name', SMS_R_System.AD_Site_Name0 as 'AD Site', SMS_R_System.SMS_Unique_Identifier0 as 'SMS ID', SMS_R_System.Resource_Domain_OR_Workgr0 as 'Domain', CASE When SMS_R_System.Client0 = 1 then 'Yes' else 'No' END as Client, __System_ADD_REMOVE_PROGRAMS0.DisplayName00 as 'Program Display Name', __System_ADD_REMOVE_PROGRAMS0.Version00 as 'Program Version' from vSMS_R_System AS SMS_R_System INNER JOIN Add_Remove_Programs_64_DATA AS __System_ADD_REMOVE_PROGRAMS0 ON __System_ADD_REMOVE_PROGRAMS0.MachineID = SMS_R_System.ItemKey where ( __System_ADD_REMOVE_PROGRAMS0.DisplayName00 like 'Java _ Update %' AND __System_ADD_REMOVE_PROGRAMS0.Version00 NOT IN ( select distinct top 1 Version00 from Add_Remove_Programs_64_DATA where DisplayName00 like 'Java _ Update %' order by Version00 desc ) ) order by SMS_R_System.AD_Site_Name0,__System_ADD_REMOVE_PROGRAMS0.Version00 asc It'll check for the latest version of Java (both 64bit and 32bit) and compare the version against all your machines with Java installed and give you a list of machine + site + java version installed. You can do lots of fun things in reporting to make this info look pretty. I just went with a per site summary and a machine list in the end.
Geoff Posted October 27, 2016 Author Posted October 27, 2016 Above code has a bug in the version number comparison sub query. I fixed it and here's the update. Use CM_F01 select distinct SMS_R_System.Name0 as 'Computer Name', SMS_R_System.AD_Site_Name0 as 'AD Site', SMS_R_System.SMS_Unique_Identifier0 as 'SMS ID', SMS_R_System.Resource_Domain_OR_Workgr0 as 'Domain', CASE When SMS_R_System.Client0 = 1 then 'Yes' else 'No' END as Client, __System_ADD_REMOVE_PROGRAMS0.DisplayName00 as 'Program Display Name', __System_ADD_REMOVE_PROGRAMS0.Version00 as 'Program Version' from vSMS_R_System AS SMS_R_System INNER JOIN Add_Remove_Programs_DATA AS __System_ADD_REMOVE_PROGRAMS0 ON __System_ADD_REMOVE_PROGRAMS0.MachineID = SMS_R_System.ItemKey where ( __System_ADD_REMOVE_PROGRAMS0.DisplayName00 like 'Java _ Update %' AND cast('/' + Version00 + '/' as hierarchyid) NOT IN ( select distinct top 1 cast('/' + Version00 + '/' as hierarchyid) from Add_Remove_Programs_DATA where DisplayName00 like 'Java _ Update %' order by cast('/' + Version00 + '/' as hierarchyid) desc ) ) union select distinct SMS_R_System.Name0 as 'Computer Name', SMS_R_System.AD_Site_Name0 as 'AD Site', SMS_R_System.SMS_Unique_Identifier0 as 'SMS ID', SMS_R_System.Resource_Domain_OR_Workgr0 as 'Domain', CASE When SMS_R_System.Client0 = 1 then 'Yes' else 'No' END as Client, __System_ADD_REMOVE_PROGRAMS0.DisplayName00 as 'Program Display Name', __System_ADD_REMOVE_PROGRAMS0.Version00 as 'Program Version' from vSMS_R_System AS SMS_R_System INNER JOIN Add_Remove_Programs_64_DATA AS __System_ADD_REMOVE_PROGRAMS0 ON __System_ADD_REMOVE_PROGRAMS0.MachineID = SMS_R_System.ItemKey where ( __System_ADD_REMOVE_PROGRAMS0.DisplayName00 like 'Java _ Update %' AND cast('/' + Version00 + '/' as hierarchyid) NOT IN ( select distinct top 1 cast('/' + Version00 + '/' as hierarchyid) from Add_Remove_Programs_64_DATA where DisplayName00 like 'Java _ Update %' order by cast('/' + Version00 + '/' as hierarchyid) desc ) ) order by SMS_R_System.AD_Site_Name0,__System_ADD_REMOVE_PROGRAMS0.Version00 asc
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now