SMessageBodySec = "Your computer is in a 'Pending Reboot' state." & vbCrLf & "This state is usually caused by software updates or new software installs." & vbCrLf & "For the health and security of your computer's operating system it must be rebooted. You can wait for this countdown to finish or you can reboot the computer yourself, whichever is more convenient for you."& vbCrLf & vbCrLf & "Your computer will be rebooted in " & iMinutesLeft & " minutes." & vbCrLf & "Reboot will happen at aproximately " & sRebootTime & vbCrLf & vbCrLf &"Please save all your work." 'set up the dialogue body for minutes left SMessageBodyMin = "Your computer is in a 'Pending Reboot' state." & vbCrLf & "This state is usually caused by software updates or new software installs." & vbCrLf & "For the health and security of your computer's operating system it must be rebooted. SMessageTitleSec = "Rebooting in "& iSecondsLeft & " seconds." 'set up the dialogue title for seconds left SMessageTitleMin = "Rebooting in "& iMinutesLeft & " minutes." 'set up the dialogue title for minutes left IMinutesLeft = int(iSecondsLeft/60) 'calculate minutes left for display in the dialogues SRebootTime = FormatDateTime(tRebootTime,3) 'Converts the reboot time to a string for display purposesÄO WHILE iSecondsLeft > 0 'warn user that the computer will reboot in x seconds TRebootTime = DateAdd("s",iSecondsLeft,Now) 'Calculates the time for the reboot IMins = 91 'number of minutes to countdown before reboot ' Set the number of minutes you want to countdown SET WshShell = WScript.CreateObject("WScript.Shell") So, if you need it please enjoy but give credit where its due. It keeps nagging the user with increasing frequency until either the cscript process is killed or the computer is rebooted. This script is very "in your face" about things. Unfortunately those things don't happen / don't work if the computer is sitting in a pending reboot state. only if SCCM is doing software updates or something like that. The notifications from SCCM only show up when SCCM initiates the reboot. That means, generally, that the users would only get a 5 minute warning. If set to 5400 (seconds) it would warn immediatly but not warn again until 5 minutes and even the immediate warning only pops up in the systray for a few seconds. The notifications from shutdown.exe were sufficient because it doesn't warn often enough.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |