Job Queue – custom sequence

BatchPatch Forums Home Forums BatchPatch Support Forum Job Queue – custom sequence

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #13327
    doug
    Moderator

    My first question is what is the purpose of having step 2? What is the advantage to checking for a logged-on user and logging that user off before you reboot in the following step? And what is the purpose for even checking pending reboot if you’re going to reboot no matter what in step 3? Why not just skip those steps? In the queue you posted they appear to have no real utility that I can discern. What I mean is that a reboot will automatically log the user off anyway, so what advantage is there to logging the user off first and then doing the reboot? For what you have described it seems sufficient to simply do the reboot.

    Additionally, consider that what you’re describing with first checking to see if anyone is logged on before executing a logoff procedure would also be unnecessary. That is, if you really want to perform a logoff operation separately from a reboot, you could simply execute a logoff command without ever checking to see if anyone is logged-on. Simply executing a logoff command would be sufficient. It wouldn’t matter whether or not someone was logged on or not.

    You can use the following syntax inside of a BatchPatch remote command to perform a standard logoff:
    powershell.exe -ExecutionPolicy Bypass -command "(Get-WmiObject -Class Win32_OperatingSystem).Win32Shutdown(0)"

    or a forced logoff:
    powershell.exe -ExecutionPolicy Bypass -command "(Get-WmiObject -Class Win32_OperatingSystem).Win32Shutdown(4)"

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.