# Target the exact installation directory from your registry screenshot $KaseyaDir = "C:\Program Files (x86)\Kaseya\KSAAS183612259210778" $KASetup = Join-Path $KaseyaDir "KASetup.exe" if (Test-Path $KASetup) { Write-Host "Running silent uninstall for Kaseya Instance..." # /r = Remove, /s = Silent, /g = Guid/Instance identifier Start-Process -FilePath $KASetup -ArgumentList "/r /s /g KSAAS183612259210778" -Wait -WindowStyle Hidden } # Stop and delete leftover Kaseya services Get-Service | Where-Object { $_.DisplayName -like "*Kaseya*" -or $_.Name -like "*Kaseya*" } | ForEach-Object { Stop-Service -Name $_.Name -Force -ErrorAction SilentlyContinue sc.exe delete $_.Name | Out-Null } # Clean lingering installation directory if (Test-Path "C:\Program Files (x86)\Kaseya") { Remove-Item -Path "C:\Program Files (x86)\Kaseya" -Recurse -Force -ErrorAction SilentlyContinue }