# Agent Uninstallation via Intune This document clearly explains the process of uninstalling agent via Intune. ## Table of Contents 1. [Generate Agent Cleanup Tool](#generate-agent-cleanup-tool) 2. [Create app package](#create-app-package) 3. [Configure Intune](#configure-intune) ## Generate Agent Cleanup Tool Generate agent cleanup tool by following instructions in the [document](https://www.manageengine.com/products/desktop-central/desktop_agent_uninstallation.html). ## Create app package 1. Download the zip [file](https://github.com/Microsoft/Microsoft-Win32-Content-Prep-Tool) [![Download the zip file for agent uninstallation via intune](https://www.manageengine.com/products/desktop-central/images/intune7.png)](https://www.manageengine.com/products/desktop-central/images/intune7.png) **NOTE:** Copy the `agentcleanuptoolclient.exe` to the extracted folder. 2. Extract `IntuneWinAppUtil.exe` from the downloaded zip folder and double-click the executable to provide the following input: - **Source folder:** - **Setup file:** AgentCleanupToolClient.exe - **Output folder:** - **Do you want to specify catalog folder (Y/N)?:** N 3. `agent.intunewin` will be created in the specified ``. 4. Use the **AgentCleanupToolClient.intunewin** app package for deployment in Intune. ## Configure Intune To configure the app: 1. Login to EndPoint Manager Admin Center. 2. Click on **Apps > All Apps > Add** 3. Select App Type to Windows app (Win32) [![intune select app type](https://www.manageengine.com/products/desktop-central/images/intune1.png)](https://www.manageengine.com/products/desktop-central/images/intune1.png) 4. Select package file and browse to AgentCleanupToolClient.intunewin [![Select package file and browse to AgentCleanupToolClient.intunewin for agent uninstallation via intune](https://www.manageengine.com/products/desktop-central/images/intune2.png)](https://www.manageengine.com/products/desktop-central/images/intune2.png) 5. Enter Name of the Application and Publisher Information and click Next [![Enter Name of the Application and Publisher Information and click Next](https://www.manageengine.com/products/desktop-central/images/intune3.png)](https://www.manageengine.com/products/desktop-central/images/intune3.png) 6. Provide the install and uninstall command in the program tab: - Install Command: `AgentCleanupToolClient /silent` - Uninstall Command: `AgentCleanupToolClient /silent` [![installation and uninstallation commands for agent uninstallation via intune](https://www.manageengine.com/products/desktop-central/images/intune4.png)](https://www.manageengine.com/products/desktop-central/images/intune4.png) [![select requirements to uninstall agent via intune](https://www.manageengine.com/products/desktop-central/images/intune5.png)](https://www.manageengine.com/products/desktop-central/images/intune5.png) 7. Configure Detection rule manually: - **Rule Type:** Registry - **Key Path:** HKEY_LOCAL_MACHINE\SOFTWARE\AdventNet\DesktopCentral\DCAgent - **Value name:** DCAgentVersion - **Detection Method:** Value does not exist - **Associated with a 32-bit app on 64-bit clients:** YES [![configure detection rule manually to uninstall agent via intune](https://www.manageengine.com/products/desktop-central/images/intune6.png)](https://www.manageengine.com/products/desktop-central/images/intune6.png) 8. Assign the application to your pilot users or all the users as per your requirement.