Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling Boxstarter from a scheduled task does not work #297

Closed
ian-mao opened this issue Jan 11, 2018 · 3 comments
Closed

Calling Boxstarter from a scheduled task does not work #297

ian-mao opened this issue Jan 11, 2018 · 3 comments
Labels
No Response / Stale Used on issues when additional information is requested, and no response has been given

Comments

@ian-mao
Copy link

ian-mao commented Jan 11, 2018

  1. I made sure the script is running under elevated mode
  2. I made sure there is enough delay after system startup
  3. When I run the registered scheduled task manually(through task scheduler GUI), the issue will not occur

Here is the code to do the register of the task scheduler:

$TaskActionArgument ="-noprofile -command `"&{start-process powershell -argumentList '-File C:\users\administrator\updatescript\boxstarter.ps1 -verb runas'}`""
$TaskAction = New-ScheduledTaskAction -Execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -argument $TaskActionArgument
$TaskTrigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName boxstarter -Action $TaskAction -Trigger $TaskTrigger -User administrator -Password Vmc12svt -RunLevel Highest

Here is the last lines of log I get from boxstarter:

[2018-01-11T05:27:11.0085025-08:00:::PID 2772] Boxstarter: restoring current directory location to C:\Windows\system32
[2018-01-11T05:27:11.0866436-08:00:::PID 2772] Boxstarter: Created a temporary package tmp5494.tmp from c:\users\administrator\updatescript\package.ps1 in C:\programdata\boxstarter\BuildPackages
[2018-01-11T05:27:11.0866436-08:00:::PID 2772] Boxstarter: Created a temporary package tmp5494.tmp from c:\users\administrator\updatescript\package.ps1 in C:\programdata\boxstarter\BuildPackages
[2018-01-11T05:27:11.1178792-08:00:::PID 2772] Boxstarter: Deleting previous tmp5494.tmp package
[2018-01-11T05:27:11.1647558-08:00:::PID 2772] Boxstarter: Installing 1 packages from C:\programdata\boxstarter\BuildPackages;http://chocolatey.org/api/v2;http://www.myget.org/F/boxstarter/api/v2
[2018-01-11T05:27:11.4772539-08:00:::PID 2772] Boxstarter: Installing 1 packages
[2018-01-11T05:27:11.4772539-08:00:::PID 2772] Boxstarter: Checking for Pending reboot
[2018-01-11T05:27:12.9478739-08:00:::PID 2772] Boxstarter: Detected Pending reboot
[2018-01-11T05:27:12.9478739-08:00:::PID 2772] @{Computer=WIN-6HSHKOKP31E; CBServicing=True; WindowsUpdate=False; CCMClientSDK=; PendComputerRename=False; PendFileRename=False; PendFileRenVal=; RebootPending=True}
[2018-01-11T05:27:13.1022560-08:00:::PID 2772] Boxstarter: writing restart file
[2018-01-11T05:27:13.1022560-08:00:::PID 2772] Boxstarter: writing restart file
[2018-01-11T05:27:13.2428825-08:00:::PID 2772] Boxstarter: Restore Automatic Updates from Windows Update
[2018-01-11T05:27:13.2987702-08:00:::PID 2772] Boxstarter: Enabling UAC
[2018-01-11T05:27:13.3210075-08:00:::PID 2772] Boxstarter: UAC Enabled. Disabling...
[2018-01-11T05:27:13.3366327-08:00:::PID 2772] Boxstarter: Disabling UAC
[2018-01-11T05:27:13.3680116-08:00:::PID 2772] Boxstarter: Securely Storing WIN-6HSHKOKP31E\Administrator credentials for automatic logon
[2018-01-11T05:27:13.9928920-08:00:::PID 2772] Boxstarter: Logon Set
[2018-01-11T05:27:14.0241325-08:00:::PID 2772] + Boxstarter finished Installation session. 00:00:12.4392627
[2018-01-11T05:27:14.0397597-08:00:::PID 2772] Boxstarter: Restart Required. Restarting now...
[2018-01-11T05:27:14.3366345-08:00:::PID 2772] Boxstarter: Composing record for pipeline...
[2018-01-11T05:27:14.3522593-08:00:::PID 2772] Boxstarter: writing object...
[2018-01-11T05:27:14.3522593-08:00:::PID 2772] Boxstarter: object written...

Sorry I couldn't provide more information as I'm not familiar with windows platform.

@mwrock
Copy link
Member

mwrock commented Jan 11, 2018

Boxstarter uses "Startup Programs" to invoke itself after startup. That might not work in the context of a scheduled task if it is non interactive with no active desktop.

@pauby pauby added the 0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue label Sep 11, 2018
@pauby
Copy link
Member

pauby commented Mar 18, 2019

@Castingnet I appreciate this was some time ago but did you manage to resolve this or do you have any more info?

@pauby pauby added the 0 - Waiting on User Insufficient information for issue or PR, issue may be closed if no response from user label Mar 18, 2019
@pauby pauby changed the title Install-WindowsUpdate didn't resume installation after reboot when schedule calling the boxstarter scripts at system startup Calling Boxstarter from a scheduled task Mar 18, 2019
@pauby pauby changed the title Calling Boxstarter from a scheduled task Calling Boxstarter from a scheduled task does not work Mar 18, 2019
@pauby pauby added No Response / Stale Used on issues when additional information is requested, and no response has been given and removed 0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue 0 - Waiting on User Insufficient information for issue or PR, issue may be closed if no response from user labels May 15, 2022
@pauby
Copy link
Member

pauby commented May 15, 2022

There has been no updates to this in some time, so I'm going to go ahead and close it. We can always reopen it again if needed.

@pauby pauby closed this as completed May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Response / Stale Used on issues when additional information is requested, and no response has been given
Projects
None yet
Development

No branches or pull requests

3 participants