10

Standardisation makes managed IT support easier. So, it helps if every one of your users has the latest version of the software you support installed. Luckily, some programmes can be easily installed or updated remotely using a script. 

Let’s see how you can quickly update all the endpoints you manage to the latest version of 3CX. 

 Using the code below, you can automatically scan endpoints for the outdated version of the 3CX VoIP app, uninstall them, and reinstall the latest version.

The Code


$CustomUDF=$env:CustomUDF

$ErrorActionPreference= 'silentlycontinue'

$MainDisk = No;
ForEach ($disk in (Get-PhysicalDisk | Select-Object DeviceID, MediaType, Size)){
     If ($disk.MediaType -eq 'SSD' -and $disk.Size -gt 100GB){
         $MainDisk = Yes;
         break
     }
}

$env:usrUDF = '7'
if ($env:usrUDF -and $env:usrUDF -match '^\d+$') {
    
    # Validate the variable value is between 1 and 30
    if ($env:usrUDF -ge 1 -and $env:usrUDF -le 30) {     
            New-ItemProperty -Path HKLM:\SOFTWARE\CentraStage -Name Custom$env:usrUDF -Value $MainDisk -Force | Out-Null
            write-host BitLocker key written to UDF $env:usrUDF`.
        } 
    else {
        write-host UDF must be an integer between 1 and 30.
    }
} else {
    write-host UDF value invalid or not specified - not writing results to UDF 7.
}
%SystemRoot%\System32\taskkill.exe /f /im 3CXWin8Phone.exe 

%SystemRoot%\System32\taskkill.exe /f /im 3CXClickToCall.exe 

%SystemRoot%\System32\taskkill.exe /f /im TcxPhoneUpdater.exe 

%SystemRoot%\System32\taskkill.exe /f /im CallTriggerCmd.exe 

 
taskkill /im 3CXWin8Phone.exe 

wmic product where name="3CXPhone for Windows" call uninstall /nointeractive 

 

msiexec.exe /i "3CXDesktopApp-18.10.461.msi" ALLUSERS=1 /qn /norestart /log output.log

What Happens When You Run This Code?

With a few clicks, this script can automatically remove old 3CX clients and install the latest version. Doing this using a script will save you the time of having to manually uninstall and reinstall 3CX on each machine. This helps your users have the most up to date software while also reducing the amount of engineer time that you need to spend on software updates.

Want More Expert Tips Like This?

3CX isn’t the only app that can be updated this way and this script is just one of the time-saving tips we have to offer. Our team are always looking for new ways to make MSPs’ lives easier. 

When MSPs work with our mentors, they gain the benefit of decades of combined experience across different IT sectors. This ranges from sales, marketing, support, and engineering. If you need help growing your MSP, please contact us today.

Share

Post comment

Your email address will not be published. Required fields are marked *

Go top