# How to Uninstall agent using Agent cleanup tool? **Last Updated On**: 28 Jul 2026 **6 minutes read** When an agent upgrade fails, the existing agent must be completely removed before a fresh installation can succeed. Uninstalling through the Control Panel does not remove all files, folders, and scheduled tasks left by the agent — **AgentCleanupTool** handles the full removal. ## Prerequisites - For Endpoint Central Cloud, contact support to obtain the AgentCleanupTool along with any one agent registry export. - If the Central server has already been uninstalled and agents still remain on machines, contact support with an agent registry export — the support team will supply the correct cleanup tool. ![How to export registry files for agent cleanup](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-registryexport.webp) *AgentCleanupTool.exe in the extracted folder — right-click and select **Run as administrator**.* ## Step 1: Generate Cleanup Files ### Download the AgentCleanupTool ZIP Download [Agent_Cleanup_Tool.zip](https://workdrive.zohoexternal.in/external/6d24bbfa20748b796120764dd8bfc63b1e3c1571bbc87875823b92cae08636db) to the machine where the Central server is installed. > **Note** > > The ZIP contains all three components required for cleanup across platforms — you no longer need to download the macOS pkg or any other component separately. > > - **AgentCleanupTool.exe** — main executable; run on the Central server to generate client-side cleanup files. > - **UEMS_MacAgent_Cleanup_Tool.pkg** — used for macOS agent cleanup. > - **UEMS_LinuxAgent_Cleanup_Tool** — used for Linux agent cleanup. ### Generate client cleanup files 1. Extract the ZIP and open **Command Prompt** as an administrator. ![File Explorer showing AgentCleanupTool.exe in the extracted Agent_Cleanup_Tool folder with the right-click context menu open](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-toolextract.webp) *AgentCleanupTool.exe in the extracted folder — right-click and select **Run as administrator**.* 2. Navigate to the directory where **AgentCleanupTool.exe** was extracted. 3. Run the tool on the **Central server machine**: ```bash AgentCleanupTool.exe ``` > **Warning** > > AgentCleanupTool.exe must be run on the machine where the Endpoint Central server is installed. If run on any other machine, an error will appear as shown below. ![ERROR dialog showing: Please execute the exe in Server installed machine — endpointcentral-agentp14.manageengine.in](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-windowsagentfailure.webp) *Error shown when AgentCleanupTool.exe is run on a machine other than the Central server.* When run on the correct Central server machine, a SUCCESS dialog appears confirming that **AgentCleanupToolClient.exe** has been generated. ![SUCCESS dialog showing: AgentCleanupToolClient.exe successfully generated. This tool will be valid for 2 days, applicable only when the uninstallation restriction is enabled — with an OK button](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-windowssuccess.webp) *SUCCESS dialog confirming AgentCleanupToolClient.exe generation.* Click **OK** to proceed — this also triggers the generation of **UEMS_MacAgent_UninstallInfo.plist** for macOS agent cleanup and **UEMS_LinuxAgent_UninstallInfo.json** for Linux agent cleanup in the same directory. > **Warning** > > - All generated files (**AgentCleanupToolClient.exe**, **UEMS_MacAgent_UninstallInfo.plist**, and **UEMS_LinuxAgent_UninstallInfo.json**) are valid for **48 hours** only. If they expire, re-run **AgentCleanupTool.exe** on the Central server to regenerate them. > - Do not rename any of the generated files. ## Step 2: Uninstall the Agent Select your platform and follow the steps to remove the agent. ### Windows 1. Copy **AgentCleanupToolClient.exe** to the target Windows machine where the agent needs to be removed. 2. Run **AgentCleanupToolClient.exe** as an administrator. > **Warning** > > Do not run AgentCleanupToolClient.exe from the directory where the agent is installed. ### macOS 1. Copy both **UEMS_MacAgent_UninstallInfo.plist** (generated in Step 1) and **UEMS_MacAgent_Cleanup_Tool.pkg** (from the ZIP) to the target Mac machine. Both files must be in the same folder. 2. Double-click **UEMS_MacAgent_Cleanup_Tool.pkg** and complete the prompts as an admin user. ![Extracting the Mac agent cleanup tool package](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-macagentextract.webp) ![Running the Mac agent cleanup tool](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-macagentrun.webp) ![Mac agent cleanup tool showing successful removal](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-macagentsuccess.webp) ![Mac agent cleanup tool confirmation of completion](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-macagentfailure.webp) ### Linux 1. From the extracted ZIP, locate **UEMS_LinuxAgent_Cleanup_Tool**. 2. Copy both **UEMS_LinuxAgent_UninstallInfo.json** (generated in Step 1) and **UEMS_LinuxAgent_Cleanup_Tool** to the target Linux machine. Both files must be in the same folder. 3. Run the cleanup tool using the following command: ```bash chmod +x UEMS_LinuxAgent_Cleanup_Tool && ./UEMS_LinuxAgent_Cleanup_Tool ``` ![Linux agent cleanup tool showing successful agent removal](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-linuxsuccess.webp) *SUCCESS dialog confirming Linux Agent removal.* ![Linux agent cleanup tool showing failed agent removal](https://cdn.manageengine.com/sites/meweb/images/desktop-central/help/device-onboarding/agentcleanup-linuxfailure.webp) *FAILURE dialog confirming Linux Agent is not removed.* ## Remove the Computer from the Server The AgentCleanupTool removes the agent software from the endpoint only. To remove the computer record from the Endpoint Central console, navigate to **Agent → Computers**, select the computers to remove, and choose **Remove Computers**. ## Related - [Agent Installation](https://www.manageengine.com/products/desktop-central/help/device-onboarding/agent-installation.html) - [Uninstall Agent](https://www.manageengine.com/products/desktop-central/agent-uninstallation-methods.html)