Application Removal Issues - Kaspersky


Recently I have been attempting to setup the removal of Kaspersky from our computers via PSAppDeployToolkit. There are two components installed on the machines for this, of which one is installing fine using:

Remove-MSIApplications -Name ‘Kaspersky Security Center Network Agent’

The problem lies in the removal of the primary component that actually needs to be removed first, which is the “Kaspersky Endpoint Security 10 for Windows” piece of things. I have tried both of the following:

Remove-MSIApplications -Name ‘Kaspersky Endpoint Security 10 for Windows’
Execute-MSI -Action Uninstall -Path {7A4192A1-84C4-4E90-A31B-B4847CA8E23A}

Neither of these will remove the program, it simply skips over this step and will process the Network Agent removal. I believe this is related to the uninstall requiring a username/password during the process. I have attempted to use both the Parameters & AddParameters arguments to pass this through to no avail. Something like:

Execute-MSI -Action Uninstall -Path {7A4192A1-84C4-4E90-A31B-B4847CA8E23A} -AddParameters KLLOGIN=KLAdmin KLPASSWD=unload

Any suggestions on how to process this uninstall while using the username/password? I have found the information on Kaspersky’s website for command line removal here:

Thanks in advance!

For this, we’ll need more info on the installer.

Look at the documentation that Kaspersky provides and see how they suggest doing a silent uninstall. Once you know that we can help you build the proper command line

For this, we’ll need more info on the installer.

Look at the documentation that Kaspersky provides and see how they suggest doing a silent uninstall. Once you know that we can help you build the proper command line

The information they have provided on their website for uninstall is as follows:

To remove Kaspersky Endpoint Security 10 for Windows version,, or later, run the msiexec command with KLLOGIN=login and KLPASSWD=password keys with the license key 7A4192A1-84C4-4E90-A31B-B4847CA8E23A. For example:

msiexec /x {7A4192A1-84C4-4E90-A31B-B4847CA8E23A} /qn KLLOGIN=user KLPASSWD=123

Try this please:
Execute-MSI -Action Uninstall -Path “{7A4192A1-84C4-4E90-A31B-B4847CA8E23A}” -AddParameters “KLLOGIN=”“KLAdmin”" KLPASSWD="“unload”""

be careful about copying pasting that, though, I’d suggest writing it out. Surround everything you’re passing to addparameters with double quotes, then use double double quotes within there to surround the values you’re passing the parameters.

Let me know how that goes

That didn’t seem to do it unfortunately to say, and I made sure to type out the entire line manually to ensure no pasting issues. The error I am getting is attached, please advise if you are unable to view the image though.


Hey Kyle,
I’m not able to download that file now. If you can copy and paste the relevant info from the log to the comment section I can take a look. Otherwise we’ll need to wait until I’m home tonight.

Ok, I’ve looked at it. can you please paste the commandline you’re using. It’s showing an issue with the value you’re passing to the Path parameter. There’s something wrong there.

Here is the Pre-Installation/Uninstall phase:

<pre class=“brush: powershell; gutter: true; first-line: 1; highlight: []; html-script: false”>If ($deploymentType -ine ‘Uninstall’) {
[string]$installPhase = ‘Pre-Installation’

	## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
	Show-InstallationWelcome -CloseApps &#039;avp,avpsus,klnagent&#039; -Silent -BlockExecution
	## Show Progress Message (with the default message)
	Show-InstallationProgress -StatusMessage &#039;Removal of Kaspersky is now in progress&#039;
    # Remove any previous version of Kaspersky
    Execute-MSI -Action Uninstall -Path {7A4192A1-84C4-4E90-A31B-B4847CA8E23A} -AddParameters &quot;KLLOGIN=&quot;&quot;KLAdmin&quot;&quot; KLPASSWD=&quot;&quot;unload&quot;&quot;&quot;
    Remove-MSIApplications -Name &#039;Kaspersky Security Center Network Agent&#039;</pre>

You’ll need to surround the product guid with quotes. There is an example in the documentation.
Look at my comment, I edited it a little while after posting it, and you might have tried one of the older versions.

Try single quotes too instead of double quotes when surrounding the product guid.

Well that was it! I missed the quotes you added in that upper comment, my apologies. As soon as I added those both products uninstalled correctly. Now to add my install string below and we’ll be all set!

Thanks so much for your help Aman, it’s GREATLY appreciated!!

i know this discussion has been inactive, but this is precisely what I am dealing with right now. I have 2 sites, both users of Kaspersky Endpoint Security 10 for Windows. one site has a server, one does not. the license is expired for the site with the server, the lics are inactive at the other location but no server.

so I have the same thing happening… its actually how I found this page, I have an MSI GUID like this:

and this was the first hit. I am literally at the same state as the OP on post 1. I have the password and username, but I don’t even understand what you guys are doing in powershell above… well, I do, but I don’t understand how I am supposed to use that to get this removed. do I need to have the powershell app deployment toolkit installed to compile this? I’m lost on that part… ideally I want to be able to use my RMM (Automate) to execute the line:
Execute-MSI -Action Uninstall -Path “{7A4192A1-84C4-4E90-A31B-B4847CA8E23A}” -AddParameters “KLLOGIN=””KLAdmin”” KLPASSWD=””KaseyaUninstall”””

of course, I have modified the line to have the username and password for the instance I am working with. so do I need to install the psapp stuff on my station so I can compile a .ps1 file here and then use it to push?

it doesn’t look like kyle is active, hopefully someone will see this and point me in the right direction. thanks in advance.

ok, i figured out the psappdtk part. i have that sorted out. i am looking at the default script…, but im still lost.

maybe if kyle could post the entire script he has in the ISE i could copy and paste it and give you $20. sheesh, im not a scripting master and i could use a solid, i have 150 stations i need to remove this KES from.

so assuming that i have admin access to all the stations and the kapersky password, what would my final window look like? sorry for being a n00b, i do azure powershell, this is not familiar to me at all.

This is Kyle, for some reason I am not able to logon with the original account I used. I keep getting errors regarding API stuff… Anyway!

The PSAppDeploy Toolkit is required “as a whole” to be able to use all of the functions that have been outlined/discussed. I was able to get this working as I had stated and I used SCCM to deploy out the uninstall of KAV followed by an install of Trend Micro OfficeScan. We have had 2-3 machines that would flat out not remove KAV and had to reimage them, but overall it worked.

Feel free to email me to discuss further:

haha! you rock… so i played with it and played with it and i gave up with the PSApps… but i was able to use my cmd lina ninja skillz to get it removed like so:

msiexec.exe KLLOGIN=KLAdmin KLPASSWD=KaseyaUninstall /x {7A4192A1-84C4-4E90-A31B-B4847CA8E23A} /qn

but it took a minute because its arguments and switches are in a weird order. but i am super appreciative of the reply, i would never have figured this out without your original post.

thanks so much!