Use BatchPatch scheduling with a list

BatchPatch Forums Home Forums BatchPatch Support Forum Use BatchPatch scheduling with a list

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8967
    Stephen
    Participant

    Hi,

    Is there a way to have BatchP read from a list when using the task scheduler feature to install updates ?

    Regards,

    Stephen

    #10487
    doug
    Moderator

    Hi Stephen – I’m sorry to say that I don’t fully understand what you are asking. What kind of list do you want BatchPatch to read? And what would reading such a list accomplish? In the way that your current question is phrased it’s unclear what you are trying to accomplish. What does reading a list have to do with using the task scheduler to install updates? What is in the list? What should BatchPatch do with the information that it reads from the list? Please clarify with as much detail as possible in describing exactly what you are trying to accomplish.

    Thanks,

    Doug

    #10488
    Stephen
    Participant

    Hi Doug,

    Apologies if my question was vague.

    We would like to automate patching for machines and thus we have created scripts that check if users are currently logged on, if there is no one logged on to a particular machine it outputs the machine name to a list

    Id like to run BatchP daily against that list.

    is this at all possible ?

    Regards,

    Stephen

    #10485
    doug
    Moderator

    In the way that you describe, the list could not be auto-imported into BP. You would have to manually pull the list into BP and execute the desired Windows Update action.

    However, let me propose two alternate ways that you could accomplish what you are trying to do:

    1. The BP job queue has an option ‘Wait for host to have zero logged-on users’ in the “Special” list. You could create a job queue that looks something like this:

    Wait for host to have zero logged-on users
    Download and install updates + reboot if required

    Then create a scheduled task to execute that job queue. The only issue I see here is that if you choose to have the scheduled task repeat daily, and if the computer has logged on users each time the task runs, I’m not 100% certain how things will go if the previous day’s task is still waiting for the host to have zero logged-on users when the next day’s task executes. I think this will cause multiple ‘wait…’ actions to start (one ‘wait…’ action for each day). When the computer finally has zero logged on users, one of those ‘wait…’ threads will probably execute just fine with all of the other ‘wait…’ threads then failing to execute. This might end up working just fine despite the fact that you would see a bunch of failures/errors, but I’m not positive. Also, I believe it would create a thread leak because BP would create a new thread each day for each host that is doing nothing but waiting for there to be no logged on users. The leak would be cleaned up only when those threads are returned to the pool when the target host finally has no logged on users.


    2. To avoid the potential issue that I described in method number 1 you could write your own script to check for logged-on users and return 0 if no logged-on users are found but return any non-0 integer if logged-on users are found. Then you could add that custom script to a BP job queue that looks something like this:

    Execute custom script
    Terminate queue if previous action fails/errors
    Download and install updates + reboot if required

    In this way your custom script would execute first. If it returns 0 then BP will execute ‘Download and install updates + reboot if required’, but if it returns a non-0 value then BP will terminate the queue. If you have this queue set to execute daily via scheduled task, it should give you exactly what you want. There is an example of integrating a custom script into BP posted here. If your script simply returns the number of logged-on users, that would be sufficient for this to work because when 0 logged on users are found your script would return 0, which is what would be needed for this to function as I described.

    -Doug

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