Windows rollback

I need to deploy an application that will allow a user to rollback windows. I know that I need to run DISM /Online /Initiate-OSUninstall
I have tried to run the DISM from within Main install as well as save it to the local computer in a powershel script and execute it from there. The problem is I am unable to notify the user that a restart is required.
I hope someone can point me in the correct direction.

According to DISM Operating System uninstall Command-Line Options | Microsoft Learn “By default, you’ll be prompted to restart the PC after running this command. You can choose to suppress the prompt by either specifying the /Quiet option, which allows the restart the happen automatically, or specifying the /NoRestart option, which will require the PC to be restarted manually.”

I suppose that the described default restart prompt isn’t working in your case? If that is correct an alternative method is to add the parameter /NoRestart to the DISM command and then use the PSADT function Show-InstallationRestartPrompt | PSAppDeployToolkit to handle the restart prompt. For example:

Show-InstallationRestartPrompt -Countdownseconds 600 -CountdownNoHideSeconds 60

I’m also suspecting this depends upon the context the deployment is being run in.
If running in the User context - does the user have the necessary rights to run the DISM command?
If running in the SYSTEM context, the user will (should) have the required rights.

How you define which context it runs from will depend on your deployment system (SCCM / Intune / other), in Intune it is set once via the Add App page:

I agree with @JFP’s reply that you may need to prompt the user to restart using the PSADT function:

to handle the restart prompt. For example:

Show-InstallationRestartPrompt -Countdownseconds 600 -CountdownNoHideSeconds 60

1 Like

Thank you! I don’t know why I didn’t think of this earlier.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.