There may be a time when you want to uninstall the Vanta Agent on Windows machines for your organization. The best way to do this is to first deactivate the Vanta Agent on the device, which will remove it from your Vanta instance, and then uninstall the application from the machine. Below is an example PowerShell script that can be run to perform both of these commands.

 

You will need to update the $VantaSecret variable with your Vanta Key. This is available from the unmonitored tab of the computers page:

 

VantaKey.png

 

PowerShell Script Example:

$VantaKey= "your_vanta_key"

try {
C:\ProgramData\Vanta\vanta-cli deactivate --secret=$VantaKey
}
catch {
"Unable to Deactivate the Vanta Agent, please reach out to support."
}
try {
$application = Get-WmiObject -Class Win32_Product -Filter "Name = 'Vanta Agent'"
$application.Uninstall()
}
catch {
"Unable to uninstall the Vanta Agent, please reach out to support."
}
finally {
"vanta Agent Successfully Deactivated and Uninstalled"
}