appsettings.json
file from the existing web console and server installation.appsettings.json
file in the web console directory alongside your backed-up version.appsettings.json
to the new one.appsettings.json
files for the web console and server with those in the documentation (link) and adjust accordingly.latest
tag, pull the new images with docker pull
. If you’re using a specific version, update the tag in docker-compose.yml
or your docker run
command to 2.5.0.0
.TRUNCATE TABLE servers;
With the introduction of the new multi-platform agent in version 2.5.0.0, auto-update will not work in this case. To upgrade, you must manually execute a PowerShell script on your machines to replace the old NetLock RMM agent. This process can be automated using NetLock’s job feature, remote shell or you can use active directory too.
$DownloadUrl
variable with the copied download link.
# Name of the service to be checked
$ServiceName = "NetLock_RMM_Comm_Agent_Windows"
# Services to stop before installation
$ServicesToStop = @(
"NetLock_RMM_Comm_Agent_Windows",
"NetLock_RMM_Health_Agent_Windows",
"NetLock_RMM_Remote_Agent_Windows"
)
# Path to the completion marker file
$CompletionMarker = "C:\temp\netlockinstalled2500.txt"
# Download URL and paths
$DownloadUrl = "https://demo.netlockrmm.com:7443/admin/files/dow..." # put your URL here
$DownloadPath = "C:\temp\netlock_rmm_agent.zip"
$ExtractPath = "C:\temp\netlock_rmm_agent"
$InstallerPath = "$ExtractPath\NetLock_RMM_Agent_Installer.exe"
# Function to stop services
function Stop-Services {
param ([string[]]$ServiceNames)
foreach ($serviceName in $ServiceNames) {
$service = Get-Service -Name $serviceName -ErrorAction SilentlyContinue
if ($service -and $service.Status -eq 'Running') {
Write-Output "Stopping service: $serviceName..."
Stop-Service -Name $serviceName -Force
Start-Sleep -Seconds 3 # Wait to make sure services stopped
}
}
}
# Create temp directory if not exists
if (!(Test-Path -Path "C:\temp\")) {
New-Item -ItemType Directory -Path "C:\temp\" -Force | Out-Null
}
# Download the ZIP file
Write-Output "Downloading NetLock RMM Agent..."
Invoke-WebRequest -Uri $DownloadUrl -OutFile $DownloadPath
# Extract the ZIP file
Write-Output "Extracting files..."
Expand-Archive -Path $DownloadPath -DestinationPath $ExtractPath -Force
# Stop necessary services before running the installer
Stop-Services -ServiceNames $ServicesToStop
# Check whether the service exists
$service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
# Check if the completion marker file exists
$markerExists = Test-Path -Path $CompletionMarker
if ($service -and -not $markerExists) {
Write-Output "The service '$ServiceName' exists, but the installation is incomplete. Running the installer."
# Run the installer
Start-Process -FilePath $InstallerPath -Wait -NoNewWindow
# Validate that the service is still running after the fix
$service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
if ($service) {
Write-Output "The service '$ServiceName' was successfully installed."
# Create the completion marker file
New-Item -ItemType File -Path $CompletionMarker -Force | Out-Null
Write-Output "Completion marker file created at '$CompletionMarker'."
exit 0
} else {
Write-Output "Installation failed. The service '$ServiceName' is no longer registered."
exit 1
}
} elseif (-not $service) {
Write-Output "The service '$ServiceName' does not exist. Running the installer."
# Run the installer
Start-Process -FilePath $InstallerPath -Wait -NoNewWindow
# Validate that the service was registered
$service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
if ($service) {
Write-Output "The service '$ServiceName' was successfully installed."
# Create the completion marker file
New-Item -ItemType File -Path $CompletionMarker -Force | Out-Null
Write-Output "Completion marker file created at '$CompletionMarker'."
exit 0
} else {
Write-Output "Installation failed. The service '$ServiceName' was not found."
exit 1
}
} else {
Write-Output "The service '$ServiceName' exists and the installation is already complete. No action required."
exit 0
}