/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Trying to uninstall and install an older version agent via script

10/06/2020 168 views

I know how this may sound weird, but here goes.  We currently have around 200 machines that use File Synchronization.  We were using the 10.0 agent with no issue.  I made the silly mistake of having them auto update to 11.0 (Beta, I know).  However, when that happened, the file sync is now intermittent and deleting random files every time that the devices check in.  


Now to the fun part.... I am trying to uninstall KACE and reinstall, through KACE.  I know that sounds really weird, but hear me out.  I created a batch file stored outside of the KACE install location.  I then used a script to call on the batch file (which I should think would run all the way through.)  However, when I get to the part where KACE is uninstalled, I believe it stops.  I'm guessing it is because KACE somehow is hosting the batch file.  I'm not exactly sure if that is what is happening.  I am wondering if anyone else has experience with this and what they have done.  I would rather not have to roll back by manually uninstalling/reinstalling the agent on around 200 machines.


Again, this is what I did... Put batch files and other files synced to a location outside of the KACE installation.  Call the batch file (not in KACE) from a script.  Batch file gets to where KACE is uninstalled and then stops.  Anyone have any similar things that they have done that have worked?

0 Comments   [ + ] Show comments

Comments


All Answers

0

I believe the problem is that the batch file runs under the context of the KACE agent, so when the KACE agent is uninstalled it kills any processes it started. I don't think trying to use KACE to uninstall the beta agent and install the stable one will work.

I frequently use PowerShell remoting to connect to computers using the command line. If your computers are in Active Directory, it's not hard to setup a Group Policy to enable remoting. Take a look at this site:

https://www.techrepublic.com/article/how-to-enable-powershell-remoting-via-group-policy/

If you get remoting working, then you can use KACE to push your uninstall/install batch file to the clients, then use PowerShell to run the batch file. If the filename is 

C:\Windows\Temp\Install-OldKACEAgent.bat

You could use PowerShell like this

$Computers = 'computer1.domain.local', 'computer2.domain.local', 'computer3.domain.local'
Invoke-Command -ComputerName $Computers -Script {C:\Windows\Temp\Install-OldKACEAgent.bat}

If you don't know PowerShell or use remoting, I recommend you learn a bit about both. With 200 computers, it could be a worthwhile investment of your time.


Answered 10/06/2020 by: PaulGibson
Orange Belt

  • That is what I figured. That's actually a great way to do it! Thank you! I actually finally tried out Lansweeper, which we had for years to do it. It worked out great for deployment.
0

to replace the agent via script the script needs to be an offline script, since the agent needs to be stopped for the installation.

But since this is a BETA, I _URGENTLY_ suggest you to contact the beta team with the email you got to analayze and fix it. This is what a Beta is for. With simply uninstalling it it does not help. Since it may be that others run into this issue too and a fixed agent would fix the issue.

Answered 10/07/2020 by: Nico_K
Red Belt

  • Thanks Nico. I have been in contact with the BETA team about it. We even had a call about it. Sadly, timing was not on the BETA's side. We successfully rolled it back using another tool we have called Lansweeper. It's good to know we have some other tools in our arsenal.
0

Use these steps:

For Workgroup Set Up

  1. Download the script UnInstallDCAgent.txt
  2. Rename it to UnInstallDCAgent.vbs
  3. Run the script in all the client computers from the command prompt: CSCRIPT UnInstallDCAgent.vbs

For Active Directory Set Up

If you have a Windows Active Directory setup,

  1. Download the script UnInstallDCAgent.txt
  2. Rename it to UnInstallDCAgent.vbs.

    Note: You should perform the following steps in the Domain Controller. For the script to execute successfully, the file association of .vbs files should be set to "Microsoft Windows (r) Based Script Host" in all the client computers. If this has been modified to some text editor, the scripts will not execute.

  3. Start -> Run -> gpmc.msc
  4. Right-click the domain and select Create and Link a GPO here.
  5. Specify a name for the GPO
  6. Select the GPO from the tree. Ensure that the Scope tab --> Security Filtering has the Authenticated Users group added.
  7. Right-click the GPO and select Edit.
  8. Expand Computer Configuration --> Windows Settings --> Scripts.
  9. Right-click Startup and select Properties.
  10. Click Show Files and drag and drop the UnInstallDCAgent.vbs to this location and close.
  11. In the Startup Properties dialog, click Add.
  12. Browse to select the UnInstallDCAgent.vbs script.
  13. Click OK to close the Add a Script dialog
  14. Click OK to close the Startup Properties dialog
  15. Close the Group Policy Object Editor
  16. Close the Group Policy Management dialog.
Answered 10/19/2020 by: Bruce9910
White Belt

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ