Skip to content

ninjaone_uninstall.ps1

Corey Watson edited this page Dec 1, 2025 · 1 revision

ninjaone_uninstall.ps1

Completely removes NinjaOne RMM agent and Ninja Remote from a Windows system.

Overview

This script performs a comprehensive uninstallation of the NinjaOne RMM agent and Ninja Remote components. It handles all aspects of removal including disabling uninstall prevention, removing services, cleaning up registry entries, and removing the virtual display driver.

Purpose

Completely removes NinjaOne RMM agent and Ninja Remote from a Windows system. Includes disabling uninstall prevention, removing services, cleaning up registry entries, and removing the virtual display driver.

Prerequisites

  • Windows OS
  • Administrator privileges

Configuration

Required Inputs

None - script auto-detects NinjaOne installation

Behavior

  1. Checks for administrator privileges
  2. Locates NinjaOne installation path
  3. Disables uninstall prevention
  4. Runs MSI uninstaller silently
  5. Stops and removes NinjaOne services
  6. Kills running processes
  7. Removes installation directories
  8. Cleans up registry entries
  9. Removes Ninja Remote components
  10. Removes virtual display driver

Security Notes

  • No secrets in logs
  • Creates transcript log in Windows\temp

Exit Codes

  • 0 = Success (or partial success with warnings)
  • 1 = Failure (requires admin privileges)

Example Output

[ SETUP ]
--------------------------------------------------------------
Transcript logging started
Log Path : C:\Windows\temp\NinjaRemoval_01-12-2024_143022.txt

[ LOCATE INSTALLATION ]
--------------------------------------------------------------
Registry Path : HKLM:\SOFTWARE\WOW6432Node\NinjaRMM LLC\NinjaRMMAgent
Install Location : C:\Program Files\NinjaRMMAgent

[ UNINSTALL AGENT ]
--------------------------------------------------------------
Disabling uninstall prevention...
Running MSI uninstaller...
Finished running uninstaller

[ STOP SERVICES ]
--------------------------------------------------------------
Stopping NinjaRMMAgent service...
Stopping nmsmanager service...
Removing services...

[ CLEANUP FILES ]
--------------------------------------------------------------
Removing installation directory...
Removing data directory...

[ CLEANUP REGISTRY ]
--------------------------------------------------------------
Removing registry entries...

[ REMOVE NINJA REMOTE ]
--------------------------------------------------------------
Stopping Ninja Remote process...
Removing Ninja Remote service...
Removing virtual display driver...
Removing Ninja Remote directory...

[ FINAL STATUS ]
--------------------------------------------------------------
Result : SUCCESS
NinjaOne removal completed

[ SCRIPT COMPLETED ]
--------------------------------------------------------------

Version History

  • 2024-12-01 v1.0.0 - Initial release - migrated from SuperOps

Links

Clone this wiki locally