Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Deploy a package to a group of servers but only reboot the servers one at a time

I am running a custom windows update script against a number of windows servers. The script or even PDQ deploy has an option to reboot the machine. But is it possible to only reboot 1 machine at a time. I can not have all the servers down at once and they have to be taken down one at a time if possible?

Server One, Deploy package, If Successfully reboot, When Server One backup Deploy to Server Two

0

Comments

3 comments
Date Votes
  • You can do it with schedules.

    Schedule 1 - Deploy Windows update to all the servers but don't reboot (target all the servers)

    Schedule 2 - Run a PowerShell script to reboot them according to your logic (run it on the local host)

    0
  • Hi Wei, I am not familiar with Schedules how would that stop more than 1 server rebooting at a time ?

    I kind of need to limit a deployment to only deploy to one machine at a time, but that seems to be a global option rather than based on a task.

    0
  • I am not suggesting using Schedules to stop servers rebooting.

    My point is that you can use PDQ to push out the patch directly or run your script on all targets at once but don't reboot. then write a simple PowerShell script to reboot your servers one at time (require PowerShell remoting enabled), you can use PDQ to run it locally.

    The code would look like this

    Restart-Computer -ComputerName $svr1 -Confirm:$false -Wait -For WinRM 
    
    Start-Sleep -Seconds 300
    
    Restart-Computer -ComputerName $svr2 -Confirm:$false -Wait -For WinRM 
    
    Start-Sleep -Seconds 300
    
    Restart-Computer -ComputerName $svr3 -Confirm:$false -Wait -For WinRM 
    
    0