Principale utente con più risposte

How to reboot active PCs at the same time - weekly

Domanda

I need help with creating advertisement which will reboot all PCs at 3:00 AM at all Saturdays (weekly).

Last time I created advertisment, PC which were active at 3.00 at Saturday rebooted successfully , but PC which started at monday (not active during weekned) rebooted at monday :( right after policy refresh.

Risposte

I'm going to give a suggestion; take it with grain of salt. I think what your stated and unstated goals are is this:

1. For workstations that ARE currently on between 2am and 4am on Saturday, reboot them.

2. If a workstation picks up this advertisement and runs it between 4:01am until 1:59pm... (that entire week), it should NOT reboot.

To me, the only way to 99% guarantee that behavior is to script something--either with powershell (if you have PS on all your workstations) or vbscript. And within the script you do 2 time manipulations: 1 is to simply check the 'current time'
and 'day'. If the day <> Saturday, and the Time is not between 0200 and 0400... the script should just gracefully exit and do nothing.

The other time manipulation would follow if the date/time is correct, then there should be randomization of wait sequence... to randomly 'pause' the script for anywhere from 1 second to 100 minutes (not 120; so that it 'finishes' within the 2 hours).
Once the pause completes, then the script reboots the box.

the advert is weekly start time of 2am saturday... and yes, the machines on Monday when waking up on the network (if they were off on Saturday) will still run the advert... but because you have the time check in there it will just gracefully exit.

------------

You could... also do the exact same thing you did in post #1... But EVERY week, "someone" would have to go in and change the advertisement. The advert would have a start time of 2am, and the advert expires at 4am... of the next specifically named Saturday
date. So it's a perpetual job that someone has to do--to remember to go in and change that advert.

Although... that might be scriptable (to change the advert start and expiration time). You'd have to look at the SDK.

To power on or restart all computers in a collection from the Configuration Manager console (Configuration Manager 2007 SP2 and later)

Right-click the collection that contains AMT-based computers to power on or restart, click Out of Band Management, and then click Power Control.

Note

The Power Control option is always available for a collection, even if the collection contains resources that are not provisioned for AMT. Configuration Manager sends power control actions only to the computers that are provisioned
for AMT.

In the Power Control dialog box, select Power on if computers are turned off or Restart Computer if the computers are running, and then click OK.

To power on or restart all computers in a collection from the Configuration Manager console (Configuration Manager 2007 SP2 and later)

Right-click the collection that contains AMT-based computers to power on or restart, click Out of Band Management, and then click Power Control.

Note

The Power Control option is always available for a collection, even if the collection contains resources that are not provisioned for AMT. Configuration Manager sends power control actions only to the computers that are provisioned
for AMT.

In the Power Control dialog box, select Power on if computers are turned off or Restart Computer if the computers are running, and then click OK.

I need help with creating advertisement which will reboot all PCs at 3:00 AM at all Saturdays (weekly).

Last time I created advertisment, PC which were active at 3.00 at Saturday rebooted successfully , but PC which started at monday (not active during weekned) rebooted at monday :( right after policy refresh.

Could you please help with creating advert in correct way?

IMO, This is a bad idea to reboot all of you PCs at the same time. The main reason is that you will cause a power spike within your building and may cause circuit breakers to blow.

You could implement maintenance windows. Otherwise it's hard to control when the reboot actually happens (as you already noticed). Or write a custom script that checks the current day/time during the runtime and only reboots the computer if it's in a given
timeframe.

I'm going to give a suggestion; take it with grain of salt. I think what your stated and unstated goals are is this:

1. For workstations that ARE currently on between 2am and 4am on Saturday, reboot them.

2. If a workstation picks up this advertisement and runs it between 4:01am until 1:59pm... (that entire week), it should NOT reboot.

To me, the only way to 99% guarantee that behavior is to script something--either with powershell (if you have PS on all your workstations) or vbscript. And within the script you do 2 time manipulations: 1 is to simply check the 'current time'
and 'day'. If the day <> Saturday, and the Time is not between 0200 and 0400... the script should just gracefully exit and do nothing.

The other time manipulation would follow if the date/time is correct, then there should be randomization of wait sequence... to randomly 'pause' the script for anywhere from 1 second to 100 minutes (not 120; so that it 'finishes' within the 2 hours).
Once the pause completes, then the script reboots the box.

the advert is weekly start time of 2am saturday... and yes, the machines on Monday when waking up on the network (if they were off on Saturday) will still run the advert... but because you have the time check in there it will just gracefully exit.

------------

You could... also do the exact same thing you did in post #1... But EVERY week, "someone" would have to go in and change the advertisement. The advert would have a start time of 2am, and the advert expires at 4am... of the next specifically named Saturday
date. So it's a perpetual job that someone has to do--to remember to go in and change that advert.

Although... that might be scriptable (to change the advert start and expiration time). You'd have to look at the SDK.

You could implement maintenance windows. Otherwise it's hard to control when the reboot actually happens (as you already noticed). Or write a custom script that checks the current day/time during the runtime and only reboots the computer if it's in a given
timeframe.

So correct me if I'm wrong (I want to be 100% sure). Even if I set in Advertisement that program (dir + 'configmgr restart computer') should be fired at 3.00 at Saturday , and PC will be turned off at the weekend - PC will run advertisement right after start
(for example at Monday)

Maintenance Windows I think would be a bad choice... well, you could work it out so that it would work...

You'd have to set this ONE reboot advertisement to never check the box about "override maint. windows"

and then set every OTHER advertisement, and Deployment for updates, to "always override maint. windows"

Of course, that would mean that you've essentially said that the ONLY time computers could run things (if you honor maint windows) is between 2pm and 4pm on Saturday. Personally, I think that's a Big Bad Idea.

I think Maint. Windows is the completely wrong choice for this activity. You will be boxing yourself into a corner if you follow this route. I'm not saying you can't do it... you can plan your entire ConfigMgr schedules around this one advertisement--the
one to reboot. But ick. What a weird choice you'd make (IMO).