Deploy the Windows MSI with an RMM or MDM Platform
How-to guideInstall the CSE desktop app, and upgrade it to the latest version, from a remote monitoring and management (RMM) or mobile device management (MDM) platform
- Last validated: Nov 23, 2026
- 8 minutes to read
- How the MSI workflow matches the zero touch script
- Before you begin
- Latest version addresses
- What the script does
- The script
- Run the script
- Exit codes
- Verify the result
- Pin a version or roll back
The Windows zero touch script finds the latest version of the SonicWall Cloud Secure Edge (CSE) desktop app, downloads it, installs it, and starts the app for the signed-in user. This page shows how to do the same with the MSI from a remote monitoring and management (RMM) platform, such as ConnectWise RMM or Kaseya VSA, or from a mobile device management (MDM) platform that runs PowerShell scripts, such as Microsoft Intune. One PowerShell script handles new devices and upgrades.
Starting in February 2027, new Windows releases are published as MSI only, and the zero touch script can no longer upgrade devices. The MSI workflow on this page keeps working. See Windows Desktop App Moving to MSI-Only Installation.
We recommend App Auto Update. With App Auto Update on, CSE keeps each device current after the first install. You can still run the script on a schedule to bring devices to the newest version sooner, because auto update makes a new version available about one week after its release. See App Auto Update.
How the MSI workflow matches the zero touch script
| Zero touch script step | MSI workflow |
|---|---|
Reads the latest version from https://www.banyanops.com/app/windows/v3/latest |
Reads the latest MSI from the address for the device’s architecture. See Latest version addresses. |
| Downloads the EXE installer | Downloads the MSI, and checks its digital signature |
| Stops the app before it installs | Not needed. The MSI upgrades the app in place. |
Writes mdm-config.json and stages the device with the deployment key |
Passes the invite code, deployment key, and other settings as MSI properties. The MSI writes mdm-config.json and stages the device. |
Creates the Windows Firewall rule, if ALLOW_APP is set |
Passes ALLOW_APP=true |
| Starts the app for the signed-in user | Starts the app for the signed-in user, if it is not already running |
Runs the upgrade flow when you pass upgrade upgrade |
Runs an upgrade automatically when the app is already installed. No invite code or deployment key is needed. |
From v4.8.0, the MSI also upgrades EXE installations in place, including legacy Banyan installs. The device keeps its registration and settings, so you do not need to know which installer each device uses.
Before you begin
- Get the invite code and deployment key. In the CSE Command Center, go to Settings > SonicWall CSE Client > the Deployment tab. You need them only for new devices.
- Run the script with administrator rights, in 64-bit PowerShell. Configure your platform to run PowerShell as the
SYSTEMaccount or as a local administrator. Some RMM agents start 32-bit PowerShell by default. The script stops with exit code1if it runs in 32-bit PowerShell on 64-bit Windows. See Run the script. - Allow the download. Devices need outbound HTTPS access to
www.banyanops.com. - Plan for a short interruption. Access to CSE-secured resources drops briefly while the MSI upgrades the app. Schedule fleet-wide runs outside working hours when possible.
Latest version addresses
Each address redirects to the newest MSI for that architecture. The script downloads the file that the redirect points to, and reads the version number from its file name.
| Architecture | Address |
|---|---|
| x64 (Intel or AMD) | https://www.banyanops.com/app/windows-msi/v4/latest |
| ARM64 | https://www.banyanops.com/app/windows-msi/v4/arm-latest |
When you pin a version, the script builds the file name from the version number. Every MSI is at https://www.banyanops.com/app/releases/:
| Version | x64 file | ARM64 file |
|---|---|---|
| v4.8.0 and later, such as v4.9.0 | sonicwallcse-4.9.0-x64.msi |
sonicwallcse-4.9.0-arm64.msi |
| v4.3.0 through v4.7.x, such as v4.5.1 | sonicwallcse-4.5.1.msi |
sonicwallcse-4.5.1-arm64.msi |
The MSI exists only for v4.3.0 and later.
What the script does
- Chooses the package for the device’s architecture.
- Finds the latest MSI from the redirect, unless you pass a version to pin.
- Checks the installed version. If the device already runs that version or a newer one, the script exits without changes. You can run it on a schedule safely.
- Downloads the MSI to
C:\ProgramData\sonicwallcsetemp, and stops if the file’s digital signature is not valid. - Runs
msiexecsilently with a verbose log.- On a new device, it passes the zero-touch properties, so the MSI writes
mdm-config.jsonand stages the device. - On a device that already has the app, it runs a plain upgrade. The MSI keeps the existing registration,
mdm-config.json, certificates, and tokens.
- On a new device, it passes the zero-touch properties, so the MSI writes
- Checks the
msiexecexit code. See Exit codes. - Starts the app for the signed-in user through a temporary scheduled task, as the zero touch script does, if the app is not already running. If no user is signed in, the app starts the next time a user signs in.
- Reports the result, including the state of the three CSE services.
The script
Save the script in your platform as sonicwall-cse-msi.ps1, and pass the parameters from your platform’s script variables.
# Install or upgrade the CSE desktop app with the MSI.
# Run as SYSTEM or as a local administrator, in 64-bit PowerShell.
param(
[string]$InviteCode = "", # New devices only
[string]$DeploymentKey = "", # New devices only
[string]$DeployUser = "", # Optional. Staged user name
[string]$DeployEmail = "", # Optional. Staged user email
[string]$DeviceOwnership = "C", # C = Corporate, S = Shared, E = Employee
[string]$DeviceManagerName = "", # Optional. Your RMM or MDM platform's name
[string]$Version = "", # Optional. Leave empty for the latest version
[switch]$AllowApp # Optional. Create the Windows Firewall rule
)
$ProgressPreference = "SilentlyContinue"
$releases = "https://www.banyanops.com/app/releases"
$appExe = "C:\Program Files\SonicWall Cloud Secure Edge\SonicWall Cloud Secure Edge.exe"
# Stop if the agent started 32-bit PowerShell, which reads the wrong registry view.
if ([Environment]::Is64BitOperatingSystem -and -not [Environment]::Is64BitProcess) {
Write-Output "Run this script in 64-bit PowerShell."
exit 1
}
# 1. Choose the package for this device's architecture.
# This registry value reports the native architecture, even under emulation.
$arch = (Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment").PROCESSOR_ARCHITECTURE
$arm = $arch -eq "ARM64"
# 2. Find the MSI to install: the latest one, or the pinned version.
if ($Version) {
if ([version]$Version -lt [version]"4.3.0") {
Write-Output "The MSI exists only for v4.3.0 and later."
exit 1
}
$suffix = if ($arm) { "-arm64" } elseif ([version]$Version -ge [version]"4.8.0") { "-x64" } else { "" }
$fileName = "sonicwallcse-$Version$suffix.msi"
} else {
$latestUrl = if ($arm) { "https://www.banyanops.com/app/windows-msi/v4/arm-latest" }
else { "https://www.banyanops.com/app/windows-msi/v4/latest" }
try {
$resp = Invoke-WebRequest -Uri $latestUrl -MaximumRedirection 0 -UseBasicParsing -ErrorAction SilentlyContinue
} catch {
$resp = $_.Exception.Response
}
$location = if ($resp) { [string]$resp.Headers.Location } else { "" }
# Use the file name from the redirect, so new file names keep working.
if ($location -match '/app/releases/(sonicwallcse-([0-9]+\.[0-9]+\.[0-9]+)[A-Za-z0-9-]*\.msi)$') {
$fileName = $matches[1]
$Version = $matches[2]
} else {
Write-Output "Could not find the latest MSI at $latestUrl."
exit 1
}
}
# 3. Check the installed version.
$installed = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*,
HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -match "Cloud Secure Edge|Banyan" } |
Select-Object -First 1
if ($installed -and ([version]$installed.DisplayVersion -ge [version]$Version)) {
Write-Output "Version $($installed.DisplayVersion) is installed. No update needed."
exit 0
}
if (-not $installed -and (-not $InviteCode -or -not $DeploymentKey)) {
Write-Output "The app is not installed. Pass -InviteCode and -DeploymentKey for a new device."
exit 1
}
# 4. Download the MSI and check its signature.
$dir = Join-Path $env:ProgramData "sonicwallcsetemp"
New-Item -ItemType Directory -Path $dir -Force | Out-Null
$msi = Join-Path $dir $fileName
$log = Join-Path $dir "install-$Version.log"
Invoke-WebRequest -Uri "$releases/$fileName" -OutFile $msi -UseBasicParsing
$signature = Get-AuthenticodeSignature -FilePath $msi
if ($signature.Status -ne "Valid") {
Write-Output "The MSI signature is not valid: $($signature.Status)."
exit 1
}
# 5. Install or upgrade.
$msiArgs = @("/i", "`"$msi`"", "/quiet", "/norestart", "/l*v", "`"$log`"")
if (-not $installed) {
$msiArgs += "INVITE_CODE=$InviteCode", "DEPLOYMENT_KEY=$DeploymentKey",
"DEVICE_OWNERSHIP=$DeviceOwnership", "IS_MANAGED_DEVICE=true"
if ($DeployUser) { $msiArgs += "DEPLOY_USER=$DeployUser" }
if ($DeployEmail) { $msiArgs += "DEPLOY_EMAIL=$DeployEmail" }
if ($DeviceManagerName) { $msiArgs += "DEVICE_MANAGER_NAME=`"$DeviceManagerName`"" }
if ($AllowApp) { $msiArgs += "ALLOW_APP=true" }
}
$process = Start-Process -FilePath "msiexec.exe" -ArgumentList $msiArgs -Wait -PassThru
# 6. Check the exit code.
switch ($process.ExitCode) {
0 { Write-Output "Installed version $Version." }
3010 { Write-Output "Installed version $Version. Windows recommends a restart." }
1618 { Write-Output "Another installation is in progress. Run the script again later."; exit 1618 }
default { Write-Output "msiexec failed with exit code $($process.ExitCode). See $log."; exit $process.ExitCode }
}
# 7. Start the app for the signed-in user if it is not running, as the zero touch script does.
$user = (Get-CimInstance -ClassName Win32_ComputerSystem).UserName
$running = Get-Process -Name "SonicWall Cloud Secure Edge" -ErrorAction SilentlyContinue
if ($user -and -not $running -and (Test-Path $appExe)) {
$taskName = "StartSonicWallCSETemp"
$action = New-ScheduledTaskAction -Execute $appExe
$trigger = New-ScheduledTaskTrigger -AtLogOn
$principal = New-ScheduledTaskPrincipal -UserId $user
$task = New-ScheduledTask -Action $action -Trigger $trigger -Principal $principal
Register-ScheduledTask -TaskName $taskName -InputObject $task -Force | Out-Null
Start-ScheduledTask -TaskName $taskName
Start-Sleep -Seconds 5
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false
} elseif (-not $user) {
Write-Output "No user is signed in. The app starts at the next sign-in."
}
# 8. Report the result and clean up.
Get-Service sonicwall-cse-admin, sonicwall-cse-wgs, sonicwall-cse-updater -ErrorAction SilentlyContinue |
Select-Object Name, Status | Format-Table -AutoSize | Out-String | Write-Output
Remove-Item -Path $msi -Force -ErrorAction SilentlyContinue
exit 0
For every other setting, add the matching MSI property to $msiArgs. See Configuration Properties.
Run the script
PowerShell parameters start with a single hyphen, such as -Version 4.8.0.
# New device: install the latest version and stage it.
.\sonicwall-cse-msi.ps1 -InviteCode <invite_code> -DeploymentKey <deployment_key>
# New device that is not joined to Microsoft Entra ID: stage it for a named user,
# record your platform's name, and create the Windows Firewall rule.
.\sonicwall-cse-msi.ps1 -InviteCode <invite_code> -DeploymentKey <deployment_key> `
-DeployUser jsmith -DeployEmail jsmith@example.com `
-DeviceManagerName "ConnectWise RMM" -AllowApp
# Existing device: upgrade to the latest version.
.\sonicwall-cse-msi.ps1
# Pin v4.8.0. On x64, the script downloads sonicwallcse-4.8.0-x64.msi.
.\sonicwall-cse-msi.ps1 -Version 4.8.0
# Pin v4.5.1 on a device that runs the MSI. On x64, the script downloads sonicwallcse-4.5.1.msi.
.\sonicwall-cse-msi.ps1 -Version 4.5.1
If your platform runs a command line instead of a script body, start 64-bit PowerShell explicitly. From a 32-bit agent, the SysNative path opens the 64-bit PowerShell:
%WINDIR%\SysNative\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -File sonicwall-cse-msi.ps1 -Version 4.8.0
From a 64-bit agent, use %WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe instead.
In Microsoft Intune, you can also deploy the MSI as a Windows app instead of a script. See Zero-Touch via Intune / Azure AD.
Exit codes
Configure your platform to treat these script exit codes as follows:
| Exit code | Meaning | What to do |
|---|---|---|
0 |
The app is installed or upgraded, or it was already up to date. | None. |
1 |
The script ran in 32-bit PowerShell, could not find the latest MSI, was given a version earlier than v4.3.0, found no installed app and no invite code, or found an MSI signature that is not valid. | Read the script output. |
1618 |
Another installation is in progress on the device. | Run the script again later. |
| Any other code | msiexec failed. |
Read C:\ProgramData\sonicwallcsetemp\install-<version>.log. See Troubleshooting and Exit Codes. |
msiexec exit code 3010 means that the install succeeded and Windows recommends a restart. The script reports it as success, and it does not restart the device.
Verify the result
- On the device: The script’s output lists the state of the
sonicwall-cse-admin,sonicwall-cse-wgs, andsonicwall-cse-updaterservices. Each one should beRunning. To check the installed version, run the PowerShell command in Check Versions and Installation Methods. - Across your fleet: In the CSE Command Center, go to Directory > Devices and download the Registered Devices report. It lists the desktop app version of each device.
Pin a version or roll back
- Pin a version: Pass
-Version. The script installs that version and does not look up the latest one. MSI packages earlier than v4.8.0 cannot install over an EXE installation, so pin v4.8.0 or later on devices that still run the EXE. If the device already runs the pinned version or a newer one, the script makes no changes. To stop App Auto Update from moving pinned devices forward, turn off App Auto Update, or addDISABLE_AUTO_UPDATE=trueto$msiArgsfor new devices. - Roll back: The MSI cannot install an older version over a newer one, so the script does not downgrade. See Downgrade a Windows Device to an Earlier Version.