Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING Restart step set to 90 minutes, devices restarting in 30 seconds

  • Thread starter Thread starter tafjeera
  • Start date Start date
  • Replies Replies 7
  • Views Views 11K

tafjeera

Member
Messages
5
Reaction score
1
Points
1
Hi all - I've just joined and have a question I hope you can assist with.

I have a task sequence set up like so:

- Install application 1 (no restart required)
- Run cmdline: Kill Process (required before installing application 2)
- Run cmdline: Stop Service (required before installing application 2)
- Install application 2 (msi with /quiet /norestart switches set on the application, I've also tried REBOOT=R)
- Restart computer (5400 seconds, display message)

It works perfectly on most Windows 10 x64 machines, but on some, and many Windows 7 x86 machines, it displays the custom restart message, but counts down 30 seconds.

I've tried various things, scoured the web for a couple of weeks, looked at logs, but can't find a solution.

Here are a couple of lines from a machine that did exactly this (in chronological order, my edits in [ ]):

Process completed with exit code 0
Successfully completed the action [redacted application name] with the exit win32 code 0
...
Set a global environment variable _SMSTSInstructionTableSize=6
Set a global environment variable SMSTSRebootRequested=
Set a global environment variable SMSTSRetryRequested=
Set a global environment variable SMSTSRebootReason=
Set a global environment variable SMSTSRebootMessage=
...
Start executing an instruction. Instruction name: Restart Computer. Instruction pointer: 5
Set a global environment variable _SMSTSCurrentActionName=Restart Computer
Set a global environment variable _SMSTSNextInstructionPointer=5
Unable to create an instance of the Progress UI COM Object. 0x8000401a.
Set a local default variable SMSRebootMessage
Executing command line: smsboot.exe /target:HD with options (0, 4)
Expand a string: WinPEandFullOS
!--------------------------------------------------------------------------------------------!
Start executing the command line: smsboot.exe /target:HD
Expand a string:
Expand a string: smsboot.exe /target:HD
Set a global environment variable _SMSTSLogPath=C:\Windows\CCM\Logs\SMSTSLog
Set a local default variable SMSRebootTimeout
SMSTSRebootMessage=[redacted application name] software has been updated. Your device will need restart for the software to initialise. **Please save your work…[shortened]
SMSTSRebootDelay=5400
SMSTSRebootRequested=HD
Running module version 5.0.8853.1000 from location 'C:\Windows\CCM\smsboot.exe'
...
========================= [ smsboot.exe ] =========================
Command line: '"smsboot.exe" /target:HD'
...
Process completed with exit code 0
!--------------------------------------------------------------------------------------------!
Successfully completed the action (Restart Computer) with the exit win32 code 0


Thanks for any help in advance.
 
Have you tried using a "Run Command Line" action instead of the "Restart Computer" using the following command:
cmd.exe /c timeout /t 15 & shutdown /r /t 5400

The 15 second lead is to let the TS engine shutdown. I remember reading about it being bad to have the final step in a TS be a restart though...
 
Thanks - I tried your suggestion with an added message pop-up, but it doesn't seem to like or handle long messages, and doesn't have a 'restart now' button.

I'd like to use the built-in step, but if it's as flaky as you say, my only option seems to be to use a batch file. Which is a shame, because I was hoping to cut out any excess with my deployments...

Do the logs provided reveal anything?
 
Do the logs provided reveal anything?
SMSTSRebootDelay=5400

Looks like the variable is set. Is that a run through of one that only gave 30 seconds though? Sounds like you're over-thinking this TS, what's with all the fuss over restarting the system?
 
SMSTSRebootDelay=5400

Looks like the variable is set. Is that a run through of one that only gave 30 seconds though? Sounds like you're over-thinking this TS, what's with all the fuss over restarting the system?

Yes, it's from one that restarted in 30 seconds.

The 1st application is an alert system and needs to re-launch after updating, and we can't trust users will do that. The second one is an SSO application that also needs to restart.

I've done some testing since, and can pretty much confirm it's the second app that's causing the reboot... but I don't know why as I tried /norestart and reboot=r on the line in sccm.
 
I've done some testing since, and can pretty much confirm it's the second app that's causing the reboot... but I don't know why as I tried /norestart and reboot=r on the line in sccm.
I share your woes with poorly packaged applications. I had a couple that were exiting with code 0 but then restarting the systems, one with no warning at all.

Maybe try altering the deployment type for your suspect application, check what exit code it's sending and add/change it in the deployment type to soft reboot, as long as CM's configured to handle reboots in a manner you like it should intercept the restart and perform it in a way you want.
 
I've been working on this since - refusing to resort to a batch file - and finally nailed it. I'm new to SCCM so this will seem silly, but I started in the wrong place, looking at the wrong logs; execmgr to be specific.

I learned to look at the AppEnforce log which gave exit code 3010 (execmgr said 0). I changed the return code behaviour in the application to Success (no reboot) and - it works.

I also learned that I was looking at this the wrong way, thinking the /norestart switch wasn't working, when it is. The application says it needs to restart (3010), but doesn't because of the switch, SCCM maps 3010 to PendingSoftReboot, and initiates a reboot.

I can see your frustration at those exit codes 0 reboots now!

One thing - after I changed the exit code behaviour and redistributed the content, the machine I was using for testing still rebooted at first, mapping 3010 to PendingSoftReboot. I waited 10 minutes, ran every policy on the client machine, ran it again and it worked. Why was it first still taking the old exit code? Does it grab it from some kind of cache?
 

Forum statistics

Threads
7,176
Messages
28,001
Members
18,304
Latest member
anthonycampbell

Trending content

Back
Top