Multiple BatchPatchExeSvc-XXXX

BatchPatch Forums Home Forums BatchPatch Support Forum Multiple BatchPatchExeSvc-XXXX

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12887
    Roey
    Participant

    Hello,
    In the ongoing work of the software, I discovered that the software opens a new process on each operation and does not remove the process after completion
    It follows that there are a large number of processes called:
    BatchPatchExeSvc-XXXX – The X represents a number
    There are dozens of such processes on every computer that the software has accessed for operation

    2 questions:
    1. How do you set the software to remove the process after completion of an operation?
    2. How do I remove the processes that are already present in all the computers in the domain?

    #12888
    doug
    Moderator

    There are a few things to note here:

    1. The service is created by psexec, and normally it is also auto-removed by psexec when it completes. There are edge cases where for unknown reasons, psexec is not able to successfully remove the service. Usually when this happens, psexec isn’t able to function properly in the first place, but in other cases it’s able to function properly with the exception of the service removal aspect.

    2. There was a brief period of a few weeks where the default behavior of BatchPatch was to append a random suffix to each execution such that a new service name would be used. We have since modified BP to no longer use this “append random suffix” option as the default option, and we reverted the default setting for all users. However, it’s possible that even if you got the new version of BP, BP wasn’t able to revert the setting for one reason or another on your instance.

    At this time I would recommend a couple of things:

    A. Make sure you’re using the latest version of psexec.

    B. Go to ‘Tools > Settings > Remote Execution’ and untick the “append random string” option. This will cause all actions to use the same remote service name. This way even if it’s not deleted successfully every time, you will only end up with a single service that stays there and gets reused, instead of numerous orphaned ones that are never reused and only keep growing in number.

    C. You can use the following syntax inside of a BatchPatch “Remote command logged output” to list the orphaned services and remove them. Just make sure to use this cautiously/carefully. Make sure it’s deleting the services that you want. The first command will find/list all of the services that contain BatchPatchExeSvc in their name. The second one will perform the same query but then also execute a deletion command for each one too.

    Get list of orphaned services:
    powershell.exe -ExecutionPolicy Bypass -command "get-service '*BatchPatchExeSvc*'"

    Delete orphaned services:
    powershell.exe -ExecutionPolicy Bypass -command "get-service '*BatchPatchExeSvc*' | ForEach-object{ cmd /c sc delete $_.Name}"

    #12889
    Roey
    Participant

    Hello Doug,
    Thanks for the quick and efficient reply!
    It seems to work very nicely according to your recommendations

    Keep up the good work
    Honestly and respectfully
    Roey

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.