ninjaone_uninstall.ps1 - limehawk/rmm-scripts GitHub Wiki
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
- Checks for administrator privileges
- Locates NinjaOne installation path
- Disables uninstall prevention
- Runs MSI uninstaller silently
- Stops and removes NinjaOne services
- Kills running processes
- Removes installation directories
- Cleans up registry entries
- Removes Ninja Remote components
- 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
- View Script Source
- Scripts - Back to script index