Jump to content

Autouninstall blacklisted software


Recommended Posts

  • 1 month later...

I'm looking into this as well. You should be able to use the same sql query to pull the blacklisted software name then pull the guid and use that for the uninstall command. The big problem is that most programs i have on the black list don't have a silent uninstaller. so even the basic scripts i have now don't work well for them.

 

I'll post what i have once I have it working better.

Link to post
Share on other sites

This is something I looked in too a while back as well, but in my experience a lot of the software out there does not have a silent uninstall command, and with those that do the command also varies a lot.

 

Therefor you could not have one script that gets called when blacklisted software is found which uninstalls a program using /s or /silent as depending on the program it will be very hit and miss.

 

Also, in my experience, the more.. dodgy.. programs you find commonly out there on PC's if they do have a silent removal command at all will change it regularly, meaning even if you did write a great script that knows how to handle most of the software you regularly come across... before too long you'll have to rewrite a lot of it again. For me, it just became more hassle than it was worth :(

 

The best I could do was to write many different scripts for the worst offending programs we had come across regularly, and test them until I got them working, then write one master script which goes through line by line, does a check for "if software installed = software name" and then each time it finds an offending item it calls the relevant removal script, but again.. over time most of the removal scripts have now stopped working and I've not had time to go through and tweak then test them all.

 

At the moment I am taking a slightly different approach, which is to use one script that calls a program that will deal with all this for me. I already have scripts that will run malwarebytes scans and I have recently implemented Labtechs Hitman Pro integration. Using groups and scheduled scripts for scanning PC's I have LT automatically finding PC's which are infected, moving them to the relevant group and regularly running licensed cleanup scans. The licenses are quite reasonably priced and while I haven't yet had time to fully test, if this works it will save me a mountain of time.

Link to post
Share on other sites

I have been working on a script to go with the blacklist monitor as well. It uses dUninstaller from here http://www.foolishit.com/vb6-projects/duninstaller/ . The program is $30 to unlock the features needed for this script. I would suggest downloading and testing out the program to make sure it can uninstall the programs you want before buying it. The program seems to solve a lot of the issues with different uninstall methods needed for different versions of ask toolbar and the like, and in general simplifies the script code needed to perform uninstalls greatly. I am also using it for OEM crapware cleanup as part of our new machine deployment.

 

Install the script, download and unzip the program files to LTShare\Transfer\Software\dUninstaller, then I would create a new alert template for blacklist uninstalls and point it at this script.

 

The script will take the programs reported by the blacklist monitor 1 at a time and add it to the txt file that dUinstaller uses as its uninstall list. If there are more it will catch them on the next monitor run time until all on the list are uninstalled from a machine. I suggest testing how each program handles being uninstalled silently before blacklisting it as some will prompt the user on the console and some programs are written specifically to not be uninstalled silently.

 

Im no expert with labtech scripting so I have it doing the most basic things right that I wanted, but there are probably some things done incorrectly especially in ticket creation/time accounting.

Monitor Uninstall Blacklisted w dUninstaller.zip

Link to post
Share on other sites

rgreen83, thanks for this. I just purchased the unlocked features but for some reason, it does not appear to be executing the uninstalls. I checked my history tab on my monitor and see a bunch of "failures". did you run into similar issues by chance?

Link to post
Share on other sites

Sorry! I forgot to mention you will have to run the GUI once to setup the program and put in your key, it creates a .ini it needs to run unattended. You should have 3 files in the ltshare\transfer\software\duninstaller folder, a .ocx, the .exe, and the .ini.

 

That would definitely be an issue, but you might also make sure that you can access your ltshare via http, that is how I have been downloading files in a lot of my scripts because doing a simple file download doesn't seem to work with variables in the path.

 

If you are still having issues let me know which script line it is failing on and I'll see if I can help further.

Link to post
Share on other sites

Odd thing is, I have the three files as I did enter the license key once extracted to ltshare\transfer\software\duninstaller.

 

I linked the script to the SW - BlackListed Install monitor and it appears it is trying to run the script, it's simply failing. Still digging but am excited if I can get this working. :)

Link to post
Share on other sites

Yes. It's so strange. I commented out the top portion of the script that pertains to the ticket creation and the script ran and I can see that it does indeed connect to my Labtech server but nothing is telling me that it is failing, just that its not uninstalling anything unfortunately.

Link to post
Share on other sites

Ok that has me stumped, the @result@ field is passed from the monitor, it should be passed the result field shown on the status page of the monitor. If that isn't happening I dont know how to fix that, it is an internal labtech function. The behavior you are describing is the same as would happen if you tried to run the script directly against a client and not called by a monitor.

 

labtech thinks it uninstalled it because it doesn't find any software installed called "@result@" if it isnt being replaced by the actual program name. Oddly enough though line 4 of the script is supposed to exit if the @result@ field is not an installed program, but it seems that isn't working either.

Link to post
Share on other sites

Anyone else managed to get this working?

 

rgreen73 - Great shout on the duninstall program. Is cheap and seems to work very well! Unfortunately I too have been unable to get it working with this script. It doesn't seem to be able to find the @result@ field and just stops before it ever runs the program, if we could somehow find a way to get your script to read the results of the monitor and call duninstaller to remove whatever the monitor has found this would be a fantastic addition to LT.

 

Richard

Link to post
Share on other sites

When the monitor triggers the alert template there should be a line pop in to the scripts tab temporarily on the offending agent that starts "status=failed" please copy that line here so I can see it (sanitize first if needed)

 

It should look like this

 

status=FAILED|fieldname=2014-05-07%2013%3A59%3A58|result=Search%20Protect|where=software|monitor=_SW%20-%20BlackListed%20Install|what=Name|ticketcreationcategory=140|message=Black Listed Application Search Protect installed on 2014-05-07 13:59:58 at XXXXX\XXXXX Remote.|tzcompdisabled=1|priority=1

Link to post
Share on other sites

The result I get is:

 

status=FAILED|fieldname=2012-10-05%2010%3A13%3A51|result=%3FTorrent|where=software|monitor=PC%20-%20BlackListed%20Install|what=Name|ticketcreationcategory=140|message=Black Listed Application ?Torrent installed on 2012-10-05 10:13:51 at Client\PC Head Office.|tzcompdisabled=1|priority=1

Link to post
Share on other sites

What is the name of the application you blacklisted, is it "? Torrent" ? I only ask because it shows the monitor is pulling the correct field I believe in the result= parameter.

 

Try adding a few lines at the top of the script please like these, and post the results of these lines from the script log

 

log %result%

log @result@

set @result@ = %result%

log @result@

 

And just to make sure you have it setup like mine, you are using an alert template with a real user account specified and calling the script from the alert template correct?

Link to post
Share on other sites

Ok, I've now managed to get this working! Been running it today and the query results of my Blacklisted Software monitor have dropped from around 500 to under 100. Hopefully the remaining ones are just because the PC's are offline.

 

To get it working I have essentially taken rgreens83's script and brought it down to the absolute basics. The version of the script I am using now will go to the PC, download the necessary files, run duninstaller using the results of the monitor as the definitions for what it needs to remove. It won't create tickets or append messages to tickets or anything else but for me it does what I need. It doesn't remove every program on the list, but it seems to get most of them and is particularly good with toolbars. Think LT has removed about 80 ask toolbars for me today!

 

As per the original post you will still need the paid version of the duninstaller software with the ini file in the right place etc

 

Massive thanks to rgreen83 for this one! This script and the software it uses is a fantastic idea and will save us mountains of time! It's still very much his script I just trimmed it down a bit as complicated scripts confuse my brain.

 

 

 

Richard

Uninstall Blacklisted Software - LTG.zip

Edited by Guest
Link to post
Share on other sites

Im glad you got it working for yourself Richard! There is a problem though, when you explicitly name a path to download a file, those files are included in the exported xml file when exporting the script and the reason your file is so large. These are then deposited at that path when importing. So right now I have your key for duninstaller which is included in the .ini file. Since I have my own I'll be deleting it but others might not and you essentially posted warez :lol:

Link to post
Share on other sites

I don't think this is working for me. All is get is the following:

 

The script(5796) was successful in the THEN section.

Start	Uninstall Blacklisted Software - LTG
IF	True		Parameter1:  	Parameter2:  	Parameter3:  	Time Taken: 37145.2391006
L3	Resend Software		Parameter1:  	Parameter2:  	Parameter3:  	Time Taken: 37146.7391582
L4	IF Software Installed		Parameter1: @result@ 	Parameter2: ! 	Parameter3:  	Time Taken: 37153.2491738

Link to post
Share on other sites

Scythe - Two reasons I can think off..

 

Are you running the script directly against a PC? My understanding is this will only work if the script is called as a result of the blacklisted software monitor calling it when it finds software on your blacklist.

 

Also can you determine if you dial in to the PC you tested this with and run dUninstaller manually does it remove the software in question that way? You will find the script can complete successfully without removing some things because these are programs duninstaller is unable to remove. There are a handful of programs on our blacklist that this program does not get rid off, but I would say it seems to remove about 80% of what i've asked of it so far so I am pretty happy with the results.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...