Configuration Manager SCCM Powershell Script Detection Method User Based Application by File Version

Zoom Client version 4.6.19253 only shows version 4.6 in program version when utilizing the registry, to get the entire version number, we have to evaluate the file version of Zoom.EXE which is 4,6,19253,0401. Further because it installs in User Context, we have to evaluate it from the following location: C:\Users\{username}\AppData\Roaming\Zoom\bin\Zoom.exe

To utilize the file version as the detection method, we have to choose Script Detection

This powershell script determines the username of the currently logged in user, if the application resides in the folder location and if it is the correct version.

#Detects if C:\Users\%username%\Appdata\Roaming\folder_name\file_or_subfolder_name exists

$loggedInUserName = $(get-wmiobject win32_computersystem).username.split("\")[1]

$version = "4,6,19253,0401"

$appPath = "C:\Users\" + $loggedInUserName + "\AppData\Roaming\Zoom\bin\Zoom.exe"

$appVersion = (get-item $apppath).versioninfo.fileversion

if( ( Test-Path $appPath) -and ( $appVersion -eq $version ) )