Already a NinjaOne customer? Log in to view more guides and the latest updates.

NinjaOne Agent: Agent Removal Guide

Topic  

This article explains how to remove the NinjaOne agent from a managed endpoint.

Environment

NinjaOne Agent

Description

This guide provides instructions for deleting an inactive, rejected, or archived device from the NinjaOne console and uninstalling the NinjaOne agent. 

Get Started: NinjaOne Removal (NinjaOne Inc. 01:13)

Select a topic to continue:

Uninstall from the NinjaOne Interface (Preferred)

If a device is online and checking in with NinjaOne, deleting a node from within NinjaOne triggers a silent uninstall of the NinjaOne agent. When uninstalling devices from NinjaOne, you have several options:

  • Uninstall at the device level: Delete a specific device. The NinjaOne agent remains installed on all other devices within that organization.
  • Uninstall from the Devices search page: Delete one or more devices regardless of their organization. The NinjaOne agent remains installed on all other devices on the console, regardless of their organization or type.
  • Uninstall from the organization level: You must use this method for Hyper-V device types. You can also reject other device types from this page, preventing the selected devices from registering in NinjaOne again. NinjaOne immediately deletes rejected devices.
When a device or organization with stored backup data is deleted or rejected in NinjaOne, or if NinjaOne Backup is made inactive for a device, organization, or account, the system will prompt the user to choose whether to keep or permanently delete all associated backup data. Refer to NinjaOne Backup: Deleting File and Folder Data for more information.

Uninstall from the Overview Tab on the Device Dashboard

  1. In NinjaOne, navigate to the dashboard of the device you'd like to remove from the platform.
  2. On the Overview tab, click the Edit menu, as shown in Figure 1.
  3. Select Delete
delete device_nms.png
Figure 1: Delete an NMS device from the device dashboard (click to enlarge)
You can perform this action for all device types except Hyper-V virtual machines and hosts. You must delete these device types from the organization configuration page in NinjaOne's Virtualization section. Deleting these device types removes the host and all guest VMs. 

Uninstall from the Devices Search Page

You can mass-delete all device types except for Hyper-V.
  1. Click Devices, select the checkboxes next to the device names, then click Delete. A notification appears to confirm the uninstallation.
delete device_multi.png
Figure 2: Delete multiple devices (click to enlarge)

Uninstall from the Organization Configuration Page

Uninstall the Hyper-V device:

  1. Open the Virtualization tab.
  2. Move your cursor over the row with the device information and click Delete
org_virtualization_delete.png
Figure 3: Delete Hyper-V devices

Reject Devices and Restrict Them from Registration in NinjaOne

  1. Open the Devices tab.
  2. Select Status.
  3. Open the appropriate tab (Pending, Approved, or Rejected) to find the device.
  4. Select the checkbox next to the device name, then click Reject
reject device.png
Figure 4: Reject and remove devices (click to enlarge)

Uninstall NinjaOne for an Entire Organization

Deleting the organization from within NinjaOne triggers a silent uninstallation of the NinjaOne agent on all devices in the organization.

  1. Click Dashboard and select an Organization.
  2. The Organization dashboard displays. Click the trash can icon.
delete org.png
Figure 5: Delete an organization (click to enlarge)
  1. A confirmation pop-up will appear. Keep any stored backup data or delete it permanently, and enter your email address to confirm.
  2. Click the Delete button to delete the node.

Manual Uninstall

Use the steps below only for cases where the agent has not checked in or the installation is corrupt.

Windows Agent Manual Removal

You can use one of the following methods to uninstall NinjaOne silently.

If you do not have uninstall prevention enabled:

Use the following command to complete the silent uninstall:

"C:Program Files (x86)<NinjaInstallFolder>uninstall.exe" --mode unattended

If you do have uninstall prevention enabled:

Follow these steps to complete the silent uninstall:

  1. Make sure that the NinjaRMMAgent service is running on the device.
  2. Run this command to restore the agent uninstaller for the device:
"C:Program Files (x86)<NinjaInstallFolder>NinjaRMMAgent.exe" -disableUninstallPrevention
  1. Run the following command to perform the silent uninstall: 
"C:Program Files (x86)<NinjaInstallFolder>uninstall.exe" --mode unattended

After Uninstallation:

To ensure complete removal, check for and delete the following folders:

C:Program Files (x86)<OrganizationName-Version>
C:ProgramDataNinjaRMMAgent
There may be multiple folders for the NinjaOne install directory found inProgram Files (x86); removing all of them is essential.

Alternatively, use the NinjaOneAgentRemoval.ps1 PowerShell script available in our Custom Script: NinjaOne Agent Removal (Windows) article. Refer to the following instructions on how to use this script.

Windows Agent Removal with PowerShell Script

You must run the script as an administrator.
  1. Download the NinjaOneAgentRemoval.ps1 PowerShell script from our Custom Script: NinjaOne Agent Removal (Windows) article. Do not save the download to Overdrive, as PowerShell may not recognize it from this location.
  2. Open Windows PowerShell from your Start menu. Ensure you run the program as an administrator. If this option is not available on the screen, right-click the application to select it. 
Powershell.png
Figure 6: PowerShell → Run as administrator (click to enlarge)
  1. If you have not already set the execution policy to allow scripts to run, use the following command:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
  1. Confirm the action if prompted.
  2. Navigate to the directory where you downloaded the NinjaOneAgentRemoval.ps1 script. Use the CD (change directory) command followed by the path to the directory containing the script. For example:
cd "C:/Users/MRogers/Desktop"
cd "Downloads"
  1. Use the command below to execute the script with the desired options.
.NinjaOneAgentRemoval.ps1
  1. If you see an error message, type the following commands, pressing the Enter key for each, before moving on to step 8:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Unblock-File -Path .NinjaOneAgentRemoval.ps1
  1. Allow the script to run until execution finishes. Depending on the actions performed, this may take several minutes.
  2. When the script fully executes, verify that the old agent has been removed and check for any error messages or prompts that may have occurred. When the script successfully removes the old agent, you can install a new agent.
  3. If you encounter any issues during the process, gather as much information as possible, including screenshots of error messages, and contact NinjaOne Support for further assistance.

macOS Agent Manual Removal

Ensure that you have removed all NinjaOne-related items before reinstalling. 
  1. Navigate to Finder.
  2. Select Applications.
  3. Find the NinjaRMMAgent folder.

    This is a hidden folder. To display the folder, use the Shift + Command + Period keys.
  4. Select Uninstall. Be sure to include the following in the uninstall:
    • networkd_settings_read_from_file Initialized network settings by reading the list directly.
    • default 09:15:44.324203+1000 ninjarmm-macagent-patcher Received configuration update from daemon (initial).
    • default 09:15:44.328373+1000 ninjarmm-macagent-patcher UNIX error exception: 17. 

Alternatively, you can use the NinjaOneAgentRemovalmacOS.sh script available in our Custom Script: NinjaOne Agent Removal (macOS) article. You must run the script as root.

Location of System Services

Use the system services below to have the NinjaOne agent download the certificate:

/Library/LaunchAgents/com.ninjarmm.trayicon.plist
/Library/LaunchDaemons/com.ninjarmm.agentd.plist
/Library/LaunchDaemons/com.ninjarmm.patcher.plist

Linux Agent Manual Removal

Change directories to /opt/NinjaRMMAgent/programfiles/ and run one of the following commands:

sudo ./ninja-deb-uninstall.sh
sudo ./ninja-deb-harakiri.sh
sudo ./ninja-rpm-uninstall.sh
If the Linux agent needs to be reinstalled following removal and fails with the error "sub-process /usr/bin/dpkg returned an error code (1)", run the following to clear out all agent files to the /tmp directory to allow for a fresh installation:
sudo mv /var/lib/dpkg/info/<packagename.*> /tmp

NinjaOne Uninstall Prevention

When NinjaOne uninstall prevention is ON, deleting a device from the NinjaOne console using the steps above still successfully uninstalls the NinjaOne agent when the device is online and connected to NinjaOne. This procedure is the recommended method of uninstallation. Refer to NinjaOne Uninstall Prevention for more information. 

If manual uninstallation is required (for example, a device is offline and not connecting to NinjaOne), but uninstall prevention is ON, use one of the manual uninstallation procedures outlined in the Windows Agent Manual Removal section of this article.

To learn about uninstalling the components from optional NinjaOne integrations (such as TeamViewer, Splashtop, Webroot, or Cloudberry), refer to Uninstalling Integrated Components.

Additional Resources

Refer to the following articles to learn more about working with the NinjaOne agent:

FAQ

Next Steps