AllowRebootPassThru

I’m completely stumped and can’t seem to figure out how to suppress a reboot but pass it back along to SCCM, to let it handle the required reboot. Any help would be greatly appreciated!

Adding ‘/norestart’ to the Execute-MSI parameter returns exit code 0

Adding ‘/promptrestart’ to the Execute-MSI parameter returns exit code 1641 and the workstation reboots immediately without continuing with the script.

Adding ‘/forcerestart’ to the Execute-MSI parameter returns exit code 1641 and the workstation reboots immediately without continuing with the script.

Changing the ‘AllowRebootPassThru’ variable from $false to $true has no effect

Adding ‘-AllowRebootPassThru’ to the install command without any effect

-AllowRebootPassThru allows 3010 to be returned from the toolkit, if not present 3010 turns to 0.
Check exit codes in application settings in SCCM to make sure 3010 is present.

Also, if -IgnoreExitCodes is set to “3010” or -ExitOnProcessFailure is set to $false, the handling of the exit code is on you.

I have confirmed the exit-codes are listed in the application settings.


I also tried adding ‘-PassThru’ to the Execute-MSI but it still forces a reboot without letting the script to finish running.

The toolkit does not restart it, the msiexec does. Could be that they modified the msi so it ignores the /norestart flag and just restarts anyway. You should be using

-Parameters '/qn /norestart REBOOT="ReallySuppress" ALLUSERS=1'

If it restarts with these anyway, then theres not much you can do. Maybe modify it in Orca.

Yes, I am aware that it’s the msiexec causing the reboot and not the toolkit.

I will give ‘/qn /norestart REBOOT=“ReallySuppress” ALLUSERS=1’ a shot and let you know the outcome.

We do own a license for Admin Studio (InstallShield) so if I modify the msi, if needed.

I might have caused some confusion, I can get msiexec to return exit-code 0 by running ‘/qn /norestart’ or ‘/qn /norestart REBOOT=“ReallySuppress” ALLUSERS=1’

My issue is that I can’t get the toolkit to capture the exit-code of 1614 or 3010 from msiexec, then return it back to SCCM.

So what is happening is msiexec will return either code back and msiexec will force windows to reboot immediately, instead of capturing the exit-code to return back to SCCM.

It’s my understanding that the toolkit is supposed to capture the exit-code from msiexec and then return it back to SCCM using ‘allowrebootpassthru’

-PassThru is not necessary. Execute-MSI does capture and return the exit code, from the msiexec and it calls Exit-Script with the exit code unless its told not to, which tells SCCM the exit code.
It should be returning 3010 with -AllowRebootPassThru to SCCM, if msiexec returned that exit code.
You can also force an exit code by typing:

$mainExitCode = 3010

If you put it after the line with Execute-MSI, if execution fails, it will not get to $mainExitCode, if it succeeds, the exit code is changed to the one you specify.

I know this is a really old post, but after the Execute-MSI command, could you check the $mainExitCode to see if it’s 0, and if it is, change it to 3010 so that if there is an error, it doesn’t pass the 3010 error code to remedy this situation?

if ($mainExitCode -eq 0) { $mainExitCode = 3010 }