Kaseya Community

ExecuteShellCommands never run

  • I'm trying to create a procedure to uninstall Office 2010 pro plus. I gave the 'executeshellcommand' command the uninstall string, and tried running it as a user. It needed admin rights. I tried running as system, no luck. 

    I tried 'Impersonate user' and the procedure just never runs. It sits listed under 'Next Exec Time' but doesn't ever actually run. I was having this issue with the initial procedures before, but that seemed to have cleared itself up. 

    Any input would be appreciated.

  • Okay, update - I figured out the commands weren't running because it was waiting for prompts. However, the new issue is that the command isn't successful. I tested the command as the admin, and it silently uninstalled Office 2010 using a config.xml file. When I login as the user, it will not actually uninstall the program. I tried this from a command line as the user as well. I've tried 'impersonating' the Admin account to no avail. Anyone have any examples of successful uninstall scripts they've run?

  • You are not alone with that problem. I got the same issue with procedure. Sometimes it just sits there and won't execute.Rebooting sometimes helps.  Besides that I had and still sometimes have problem with executing powershell commands or shell commands with agent procedure. Sometimes it works, sometimes it doesn't, on some machines works, on some doesn't work etc. Didn't find a template how it works and answer why it doesn't work sometimes. But let me try to help you here. You probably can't do this running under user context. You must run it under system or use executeshell command with credentials. Make sure your credentials works. Try to run that command locally to see if it works or not.

  • It might run, but never finish. Do you run it silently? Have you tried running the command outside Kaseya?

  • Yeah, I've got it narrowed down to just permission levels. So, the command is: %FILEPATH%\setup.exe /uninstall PROPLUS /dll OSETUP.DLL /config silentUninstall.xml

    If I run that as the user on the PC, it doesn't do anything - no error or anything. If I 'run as admin' the command prompt and enter that command, it uninstalls office.

    I tried using 'Impersonate User' and putting in the administrator account info, but no results when the command finally runs.

  • Okay, appreciate the help, but I've got it figured out - I needed to use 'useCredentials' rather than 'impersonate user'