- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
01-22-2025 11:00 PM
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.
01-28-2025 02:28 AM
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.
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!