We are deploying Java JCE Unlimited Crypto files through a K1000 File Sync, and we need to replace the originally installed version of the files, and guarantee the new file is in place. In order to do this we wanted to make use of an MD5 checksum.
Since Windows does not ahave a build in command line tool to provide this, we looked to PowerShell, since it can provide MD5 cehcksums.
First we created a new Software Inventory item, with the following Custom Inventory Rule:
ShellCommandTextReturn(powershell.exe -command "[BitConverter]::ToString((new-object Security.Cryptography.MD5CryptoServiceProvider).ComputeHash((new-object IO.FileInfo('C:\Program Files (x86)\Java\jre6\lib\security\local_policy.jar')).OpenRead())).Replace('-','').ToLower()")
You will need one Software Inventory record for each of the files provided in the JCE (local_policy.jar & US_export_policy.jar) updating the FileInfo(path) in the above line.
This will return the MD5 Checksum as a [string]
You can then create a smart label to check if the value of the software inventory record starts with the appropriate checksum value from the correct file.
Comments