Run a command if Application is deferred


Is it possible to have the deploy kit run a command if a user defers an application install.

I have an an SCCM Application deployment, and am using:
Show-InstallationWelcome -CloseApps ‘Firefox,iexplore,chrome’ -BlockExecution -AllowDefer -DeferTimes 10 -DeferDeadline ‘12/31/2017 18:00:00’ -CloseAppsCountdown 600

I’d like to add a RUNONCE registry key to run the app installation at startup if the user defers then reboots their computer.

Is this possible?

Thanks in advance for any help.


Hi Chris, did you find a solution for this. Would like to do something similar.

Hi Ronny,

Sorry for taking so long to reply.

No, I did not find an answer to this before my self-imposed deadline. So I ended up modifying the Deploy-Application.ps1 script to:

  1. Copy the app deploy package to a folder in C:\Windows\Temp
  2. Create a scheduled task at first user login to run Deploy-Application.ps1
  3. If the script is NOT deferred, then the temp copy and the scheduled task are deleted at the end of the script being run from the SCCM package.
  4. If it IS deferred, the scheduled task launches the install script when the user logs back in to a fresh session.

Seems to be working for my purposes. Hope this helps. Can provide code if you like :slight_smile: