Share via

Is there any solution to remove or offboard Microsoft Defender for Endpoint from these machines, given that the tenant is no longer active?

Vincent Chung Khui Pin 10 Reputation points
2026-04-19T13:47:24.2433333+00:00

Is there any solution to remove or offboard Microsoft Defender for Endpoint from these machines, given that the tenant is no longer active?

At the moment, I am unable to download the offboarding script since the original tenant is no longer accessible. Any guidance on how to proceed would be appreciated.

Microsoft Security | Microsoft Defender | Other

2 answers

Sort by: Most helpful
  1. Vincent Chung Khui Pin 10 Reputation points
    2026-06-08T09:34:21.6533333+00:00

    The issue has been resolved with the assistance of the Microsoft Support team

    Thanks.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. AI answer

    2026-04-19T13:47:39.1+00:00

    Yes. Offboarding and uninstalling are done locally on the machines and do not require access to the original tenant.

    Use one of these approaches, depending on OS.

    1. Decide whether to offboard only, or fully uninstall
    • Offboard: Stops communication with the Defender service and makes the agent nonfunctional, but keeps it installed. Recommended if there is any chance of reusing the agent later.
    • Uninstall: Completely removes the Defender application from the machine when it is no longer needed.

    After either offboarding or uninstalling, the agent:

    • Stops sending telemetry
    • Becomes unlicensed and nonfunctional
    • Has Defender policies removed

    Details are below.

    1. Linux servers

    A. Offboard without tenant access

    • Use the JSON-based method; it does not require downloading a fresh script from the tenant if you already have an offboarding JSON file from before. If you still have an old mdatp_offboard.json that is not expired, copy it to:
        sudo cp mdatp_offboard.json /etc/opt/microsoft/mdatp/mdatp_offboard.json
      
    • Then verify offboarding state:
        mdatp health --field health_issues
      
      Expected output:
        ATTENTION: No license found. Contact your administrator for help. ["missing license"]
      

    If no valid offboarding package is available anymore, proceed directly to uninstall (next step). Once uninstalled, the device is effectively removed from the service.

    B. Uninstall the Defender application (no tenant required)

    • Recommended method (if you can download the Defender deployment tool from any accessible tenant or if you already have it):
      1. Extract the Defender deployment tool package.
      2. Run:
             ./defender_deployment_tool.sh --remove --clean
        
    • Manual uninstallation (works entirely offline, no tenant access needed):
      • RHEL/CentOS/Oracle Linux:
            sudo yum remove mdatp
        
        or
            sudo dnf remove mdatp
        
      • SLES:
            sudo zypper remove mdatp
        
      • Ubuntu/Debian:
            sudo apt-get purge mdatp
        
      • Mariner:
            sudo dnf remove mdatp
        
    1. Windows servers
    • Offboarding Windows servers normally uses scripts or management tools (Configuration Manager, MDM, Group Policy, local script) that are downloaded from the tenant. If those are no longer available because the tenant is gone, uninstalling the unified solution or MMA agent from the server removes the Defender for Endpoint integration in practice.
    • For older, MMA-based servers, the documented offboarding options are:
      • Uninstall the MMA agent, or
      • Remove the Defender for Endpoint workspace configuration.
    1. macOS (if applicable)
    • Offboard in the portal is normally the first step, but if the tenant is gone, uninstalling the app locally removes the agent from the machine:
      • Interactive: In Finder → Applications, move “Microsoft Defender for Endpoint” to Trash.
      • Command line:
            sudo '/Library/Application Support/Microsoft/Defender/uninstall/uninstall'
        
    1. Azure VMs integrated via Defender for Cloud
    • If machines were onboarded via Defender for Cloud and that subscription/tenant is gone, you cannot toggle the integration there anymore. However, on each VM you can:
      • Remove the MDE.Windows or MDE.Linux extension from the VM (from whatever control plane is still accessible), and
      • Offboard/uninstall the agent locally as described above.

    Once the agent is uninstalled or offboarded locally, it stops communicating and is effectively removed from Defender for Endpoint, regardless of the tenant’s current state.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.