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

NinjaOne Endpoint Management: Agent Removal Guide

Topic

This article explains how to remove the NinjaOne agent from endpoints and organizations.

Environment

NinjaOne Endpoint Management

Description

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

View additional tutorials in our video library

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.
  • Uninstall from the organization level: Reject devices, triggering immediate uninstallation and preventing the selected devices from re-registering in NinjaOne. You must use this method for Hyper-V device types. You can also reject other device types by using this method.
You must uninstall Hyper-V devices from the Organization level. Refer to the Uninstall from the Organization Configuration Page section of this article for more information.
When you remove a device or organization with stored backup data, or make NinjaOne Device Backup inactive for a device, organization, or account, NinjaOne will prompt you to keep or permanently delete all associated backup data. Refer to NinjaOne Backup: Deleting File/Folder Backup 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.
  2. On the Overview tab, click the Edit menu.
  3. Select Delete device.
AgentRemoval_NewDashboardRemoval2.png
Figure 1: Delete an NMS device from the device dashboard (click to enlarge)

Uninstall from the Devices Search Page

You can mass-delete all device types except for Hyper-V devices.
  1. Click Devices, select the checkboxes next to the device names, then click Delete. NinjaOne will prompt you to confirm the uninstallation.
AgentRemoval_NewGroupDeviceDelete.png
Figure 2: Delete devices (click to enlarge)

Uninstall from the Organization Configuration Page

Use this method to remove devices at the organization level.

Uninstall Hyper-V Machines

Deleting these device types removes the host and all guest VMs.

  1. In NinjaOne, navigate to AdministrationOrganizations and select the organization.
  2. The organization's configuration page will open. Click Virtualization, then place your cursor over the host's row and click Delete.
org_virtualization_delete.png
Figure 3: Virtualization → Delete Hyper-V devices (click to enlarge)

Reject Devices and Restrict Them from Registration in NinjaOne

Follow these steps to reject devices from the organization and prevent them from reconnecting to NinjaOne.

  1. In NinjaOne, navigate to AdministrationOrganizations and select the organization.
AgentRemoval_SelectOrg.png
Figure 4: Dashboard → Select organization (click to enlarge)
  1. The organization's configuration page will open. Click Devices, then click the Status tab.
AgentRemoval_Devices_Status2.png
Figure 5: Devices → Status (click to enlarge)

3. Click the Pending, Approved, or Rejected tab to find the devices by status, then select their checkboxes and click Reject.

AgentRemoval_RejectDevices.png
Figure 6: Reject and remove devices (click to enlarge)

Uninstall NinjaOne for an Entire Organization

Use the following procedure to remove the NinjaOne agent from all devices by deleting the entire organization. Deleting the organization from within NinjaOne triggers a silent uninstallation of the NinjaOne agent on all devices in the organization.

  1. In NinjaOne, click Dashboard and select the organization.
AgentRemoval_SelectOrg.png
Figure 7: Dashboard → Select organization (click to enlarge)
  1. In the organization's dashboard, click Edit settings, then select Delete organization from the drop-down menu. A confirmation window will appear. NinjaOne will ask you if you wish to keep any stored backup data or delete it permanently. Enter your email address to confirm.
Agentremoval_SelectandDeleteOrgDevices.png
Figure 8: Edit settings → Delete organization (click to enlarge)

Manual Uninstall

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

Microsoft Windows Agent Manual Removal

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

If You Do Not Have Uninstall Prevention Activated

Use the following command to complete the silent uninstall:

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

If You Do Have Uninstall Prevention Activated

Follow these steps to complete the silent uninstall:

  1. Ensure 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 in Program Files (x86). Remove all relevant folders.

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

Use this script-based method to automate and ensure complete removal of the NinjaOne Windows agent. 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 OneDrive, 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 9: 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. 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.
cd "C:/Users/MRogers/Desktop"
  1. Use the following command to execute the script with the desired options.
.NinjaOneAgentRemoval.ps1
  1. If you receive an error message, type the following commands, pressing the Enter key for each, before moving on to step 7. These operations may take several minutes to complete.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Unblock-File -Path .NinjaOneAgentRemoval.ps1
  1. 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. 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.

Apple macOS Agent Manual Removal

Follow these steps to manually remove the NinjaOne agent and associated components from a macOS device. Ensure that you have removed all NinjaOne-related items before reinstalling.
  1. Navigate to Finder.
  2. Select Applications.
  3. Type Shift + Command + Period to reveal the hidden NinjaRMMAgent folder.
  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

Use the appropriate uninstall script below to remove the NinjaOne agent from a Linux device. 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 command 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 activated, 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 Agent: Uninstall Prevention for more information.

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

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

Additional Resources

Refer to the following articles for additional guidance on managing, uninstalling, and troubleshooting NinjaOne components.

FAQ

Next Steps