Reboot question
There might be a simple answer to this, but I wanted to reboot number of Windows servers in a collection. Servers have different versions of Windows both 32 and 64bit.We usually get a maintenance window every 2 weeks to reboot these servers.Can someone suggest an easy way of doing this?Thanks
January 5th, 2010 7:35pm
The easiest, though I have heard of a better way, would be to simply run the shutdown.exe command to run the restart. Assuming you don't need to stop services or you might have to use a -f (force) which could have dier consequences. I will say that I have only done this with workstations. As a general rule I always restart servers manually.
http://www.sccm-tools.com http://sms-hints-tricks.blogspot.com
I'm using command line shutdown.exe -r -f -t 10 -c \"Rebooting system.\"" and it is not working.Below is the execmgr.log from the client machine I am testing this on.Policy arrived for parent package LDN0000B program Reboot System execmgr 06/01/2010 10:31:54 1416 (0x0588)Raising event:[SMS_CodePage(850), SMS_LocaleID(2057)]instance of SoftDistProgramOfferReceivedEvent{ AdvertisementId = "LDN2008C"; ClientID = "GUID:50DC034C-CC35-4061-B39B-33784E3CE763"; DateTime = "20100106103154.630000+000"; MachineName = "LDITPRDTEST1"; ProcessID = 2484; SiteCode = "LDN"; ThreadID = 1416;}; execmgr 06/01/2010 10:31:54 1416 (0x0588)Mandatory execution requested for program Reboot System and advertisement LDN2008C execmgr 06/01/2010 10:35:00 2812 (0x0AFC)Creating mandatory request for advert LDN2008C, program Reboot System, package LDN0000B execmgr 06/01/2010 10:35:00 2812 (0x0AFC)CExecutionRequest::Overriding Service Windows as per policy. execmgr 06/01/2010 10:35:00 2812 (0x0AFC)Executing program shutdown.exe -r -f -t 10 -c "Rebooting system." in Admin context execmgr 06/01/2010 10:35:00 2812 (0x0AFC)Execution Manager timer has been fired. execmgr 06/01/2010 10:35:00 1272 (0x04F8)Execution Request for package LDN0000B program Reboot System state change from NotExist to NotifyExecution execmgr 06/01/2010 10:35:00 2812 (0x0AFC)GetFileVersionInfoSize failed for file \shutdown.exe, error 2 execmgr 06/01/2010 10:35:00 2812 (0x0AFC)Executing program as a script execmgr 06/01/2010 10:35:00 2812 (0x0AFC)Invalid executable file shutdown.exe execmgr 06/01/2010 10:35:00 2812 (0x0AFC)Raising event:[SMS_CodePage(850), SMS_LocaleID(2057)]instance of SoftDistProgramBadEnvironmentEvent{ AdvertisementId = "LDN2008C"; ClientID = "GUID:50DC034C-CC35-4061-B39B-33784E3CE763"; CommandLine = "shutdown.exe -r -f -t 10 -c \"Rebooting system.\""; DateTime = "20100106103501.003000+000"; DriveLetter = ""; MachineName = "LDITPRDTEST1"; PackageName = "LDN0000B"; ProcessID = 2484; ProgramName = "Reboot System"; SiteCode = "LDN"; ThreadID = 2812; Win32ErrorCode = 2147942402; WorkingDirectory = "";}; execmgr 06/01/2010 10:35:01 2812 (0x0AFC)Raised Program Bad Environment Event for Ad:LDN2008C, Package:LDN0000B, Program: Reboot System execmgr 06/01/2010 10:35:01 2812 (0x0AFC)EnterRsRuningState failed to run script shutdown.exe -r -f -t 10 -c "Rebooting system." 0x80009106 execmgr 06/01/2010 10:35:01 2812 (0x0AFC)Fatal error 0x80009106 enountered for program Reboot System. This program will not retry. execmgr 06/01/2010 10:35:01 2812 (0x0AFC)CreateMandatoryRequestRecursively Reboot System failed at EvaluateRequestForExecution execmgr 06/01/2010 10:35:01 2812 (0x0AFC)
Free Windows Admin Tool Kit Click here and download it now
January 6th, 2010 2:13pm
Someone correct me if I am wrong but isn't shutdown actually a DOS command and not an executable?If that's right it would explain why it works on 32 bit and not 64 bit machines. I've never used the shutdown command via SCCM before, but if your maintenance window is only used for rebooting the servers, I'd suggest setting up a scheduled task instead.Scott Gill
SCCM Consultant
January 6th, 2010 9:05pm
Someone correct me if I am wrong but isn't shutdown actually a DOS command and not an executable?If that's right it would explain why it works on 32 bit and not 64 bit machines. I've never used the shutdown command via SCCM before, but if your maintenance window is only used for rebooting the servers, I'd suggest setting up a scheduled task instead.
Scott GillSCCM Consultant
Doesn't setting up a scheduled task require you to log on to each server and do it?We thought by doing it from SCCM, we have more control and we get to add/remove servers if and when we need to.
Free Windows Admin Tool Kit Click here and download it now
January 7th, 2010 2:21pm
Shutdown is a windows command in the c:\windows\system32 folder or in the Wow64 folder on the 64 bit machine. It should work no matter what.Create a package with no source files, run the program in the clients folderalso the command should look like this shutdown.exe -r -f -t 10 -c "Rebooting system"
http://www.sccm-tools.com http://sms-hints-tricks.blogspot.com
Just did exactly this and once again, it is working on 32-bit systems but on 64-bit systems I get the following in execmgr.log:Mandatory execution requested for program test123 and advertisement LDN2008F execmgr 07/01/2010 11:15:00 4088 (0x0FF8)Creating mandatory request for advert LDN2008F, program test123, package LDN00090 execmgr 07/01/2010 11:15:00 4088 (0x0FF8)CExecutionRequest::Overriding Service Windows as per policy. execmgr 07/01/2010 11:15:00 4088 (0x0FF8)Executing program shutdown -r -f -c "Patch restart" -t 100 in Admin context execmgr 07/01/2010 11:15:00 4088 (0x0FF8)Execution Manager timer has been fired. execmgr 07/01/2010 11:15:00 3844 (0x0F04)Execution Request for package LDN00090 program test123 state change from NotExist to NotifyExecution execmgr 07/01/2010 11:15:00 4088 (0x0FF8)GetFileVersionInfoSize failed for file \shutdown, error 2 execmgr 07/01/2010 11:15:00 4088 (0x0FF8)Executing program as a script execmgr 07/01/2010 11:15:00 4088 (0x0FF8)Invalid executable file shutdown execmgr 07/01/2010 11:15:00 4088 (0x0FF8)Raising event:[SMS_CodePage(850), SMS_LocaleID(2057)]instance of SoftDistProgramBadEnvironmentEvent{ AdvertisementId = "LDN2008F"; ClientID = "GUID:50DC034C-CC35-4061-B39B-33784E3CE763"; CommandLine = "shutdown -r -f -c \"Patch restart\" -t 100"; DateTime = "20100107111500.163000+000"; DriveLetter = ""; MachineName = "LDITPRDTEST1"; PackageName = "LDN00090"; ProcessID = 2464; ProgramName = "test123"; SiteCode = "LDN"; ThreadID = 4088; Win32ErrorCode = 2147942402; WorkingDirectory = "";}; execmgr 07/01/2010 11:15:00 4088 (0x0FF8)Raised Program Bad Environment Event for Ad:LDN2008F, Package:LDN00090, Program: test123 execmgr 07/01/2010 11:15:00 4088 (0x0FF8)EnterRsRuningState failed to run script shutdown -r -f -c "Patch restart" -t 100 0x80009106 execmgr 07/01/2010 11:15:00 4088 (0x0FF8)Fatal error 0x80009106 enountered for program test123. This program will not retry. execmgr 07/01/2010 11:15:00 4088 (0x0FF8)CreateMandatoryRequestRecursively test123 failed at EvaluateRequestForExecution execmgr 07/01/2010 11:15:00 4088 (0x0FF8)shutdown.exe is in c:\windows\system32 on both systems. Only difference is the size.If I run the command manually from command prompt on the server, it works!
January 7th, 2010 2:25pm
Depends, on 2003 servers I believe you can do it remotely by connecting to the server with UNC paths and going to Task Scheduler (or Scheduled Tasks, I forget which). On 2008 I believe this option was removed, and in fact the whole scheduled tasks system was totally rebuilt into something different. Either way though, you should be able to do it via Script. However, as I see a script has been posted that should work with both then I think you're all set.Scott Gill
SCCM Consultant
Free Windows Admin Tool Kit Click here and download it now
January 7th, 2010 8:05pm