Uninstall Cortex XDR Agents from endpoints programmatically

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Uninstall Cortex XDR Agents from endpoints programmatically

L0 Member

Hi, 

I would like to programmatically uninstall agents from endpoints but are running into dead ends. 

Currently, based on the documentation (https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Prevent-Administrator-Guide/Uninsta...), we are only able to uninstall the agent via the Action Center or Endpoints page. However, both methods involve an administrator manually triggering the uninstallation process.

 

The API documentation does not include an API for uninstalling agents and only contain an API for deleting endpoints (https://cortex-panw.stoplight.io/docs/cortex-xdr/a9d8c8076ba24-delete-endpoints). However, the endpoint user can just reconnect since the agent was not uninstalled.

 

Alternatively, I was looking at running scripts to uninstall agents using the API (https://cortex-panw.stoplight.io/docs/cortex-xdr/7223bea7d2bea-run-script), however, I could not find any references to any scripts that could be used for uninstallation.

 

Are there any plans to make the uninstallation of agent a part of the public API, or is there a way to enable such for a tenant instance?


Context: I want to programatically uninstall agents from endpoints when certain conditions are fulfiled, by providing a list of endpoint ids to uninstall.

1 REPLY 1

L5 Sessionator

Hello @R.Pan775442 ,

 

Thanks for reaching out on LiveCommunity!

 

 AFAIK, there is no endpoint API for that. The best method here is to disabled tamper via agent profile and then you can uninstall via python script.

 

Please refer to below article as well:

https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/uninstalling-cortex-xdr/td-p/532157

 

If you feel this has answered your query, please let us know by clicking on "mark this as a Solution". Thank you.

Ashutosh Patil
  • 231 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!