Need to uninstall Qualys Agent from linux and windows server
Hi Team,
I'm looking for an option to uninstall the Qualys agent from Linux and Windows. I think I will need to use Bash/PowerShell Script to uninstall the Qualys Agent. But I'm not sure about the exact way. Also, I'm new to Kace. Could someone kindly advise on this to get this done.
Answers (1)
First and foremost:
Check the vendor for uninstall:
( for Windows as an example: https://qualysguard.qg2.apps.qualys.com/portal-help/en/ca/agents/uninstall_windows_agent.htm )
Then you can create a script: see here: https://support.quest.com/kb/4300546/k1000-script-examples-kscripts
If you click on the question mark in the blue ball under Tasks you see all variables, so you can build it without the fixed folders
Comments:
-
I was focusing on uninstalling the Qualys agent on the Linux servers, but I was unable to run the script. I got the following pop-up message:
'The script could not be run because none of the specified devices were available.'
However, the target machine is online and has the KACE agent installed.
I'm not sure what is causing this issue. Do you have any idea why this is happening?
My Script:
#!/bin/bash
# Ensure the script is running as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Use sudo."
exit 1
fi
echo "Stopping Qualys Cloud Agent service..."
systemctl stop qualys-cloud-agent.service
echo "Removing Qualys Cloud Agent package..."
dpkg --purge qualys-cloud-agent
echo "Cleaning up residual files..."
rm -rf /var/log/qualys /etc/qualys /var/lib/qualys
# Verify uninstallation
if ! dpkg -l | grep -q qualys-cloud-agent; then
echo "Qualys Cloud Agent successfully uninstalled."
else
echo "Qualys Cloud Agent uninstallation failed."
exit 1
fi - rajeshwaranm 3 weeks ago