Uninstalling The Vanta Agent - Windows Powershell

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. Here is our guide on how to Find the Vanta key from the Unmonitored tab on the Computers page.

 

PowerShell Script Example:

$VantaKey= "your_vanta_key"

try {
"C:\"Program Files"\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"
}

 

 

Updated