I'm running into a problem where I'm writing an "Onboarding" script for Windows 10 and using Schedule Tasks to run the next PoSh script after a reboot and auto login. It works fine if it never joins the domain which defeats the purpose. Below is the error I am getting with the code
When it fires this off I get the below error. The computer joins the domain as it logins after the reboot automatically under the domain account
Register-ScheduleTask : The security database on the server does not have a computer account for this workstation trust relationship.
+Register-ScheduleTask -TaskName "restart" -Action $act -Trigger $tri....
+CategoryInfo : NotSpecified (PS_ScheduleTask:Root/Microsoft/...S_ScheduleTask)
+FullQualifyErrorId: HRESULT 0x800706fb, Register-ScheduleTask