Hi there,
I want to setup a scheduled task with an after-logon post-setup command. Before logon, I move an .xml file for the scheduled task to \Windows\Setup\DisableAdmin.xml and then after logon run the following command:
Task: powershell
Parameters: $xmlPath="C:\Windows\Setup\DisableAdmin.xml";$taskName="DisableAdmin";$startTime=(Get-Date).AddDays(3).ToString("yyyy-MM-ddTHH:mm:ss");[xml]$taskXml=Get-Content $xmlPath -Raw;$taskXml.Task.Triggers.TimeTrigger.StartBoundary=$startTime;$taskXml.Save($xmlPath);schtasks /Create /TN $taskName /XML $xmlPath
If I run this locally on my Windows machine, it created the scheduled task, but when building a device with the NTLite ISO, it does not create the scheduled task. The scheduled task is to disable the administrator account after 3 days.


I want to setup a scheduled task with an after-logon post-setup command. Before logon, I move an .xml file for the scheduled task to \Windows\Setup\DisableAdmin.xml and then after logon run the following command:
Task: powershell
Parameters: $xmlPath="C:\Windows\Setup\DisableAdmin.xml";$taskName="DisableAdmin";$startTime=(Get-Date).AddDays(3).ToString("yyyy-MM-ddTHH:mm:ss");[xml]$taskXml=Get-Content $xmlPath -Raw;$taskXml.Task.Triggers.TimeTrigger.StartBoundary=$startTime;$taskXml.Save($xmlPath);schtasks /Create /TN $taskName /XML $xmlPath
If I run this locally on my Windows machine, it created the scheduled task, but when building a device with the NTLite ISO, it does not create the scheduled task. The scheduled task is to disable the administrator account after 3 days.