i have a strange Problem and i hope someone can help me.
What I’m doing:
I am creating a Scheduled Task via GPO, which starts a Powershell script which is located on a network share. The Script should run under the "System" Account. The creation is so far, working.
But when I start the Task it is exiting immediately with Exit code 0x1
The Action triggered is looking like that:
Program to start: powershell.exe Parameter: -command "& '\\%ServerFQDN\Path\Scriptname.ps1.ps1' -executionpolicy bypass"
When I change the Server FQDN to the Server name only, without the domain part, it is working.
Or, when I change the running user to my admin account it is also working. (With FQDN and with the Server name Only)
Ok so my first suggestion was: That must be an Kerberos Issue. Server name falls back to NTLM and the local system account has some kind of problem with Kerberos. So i wanted to dig deeper and get an detailed error. So, I builded a local Wrapper script which calls the subscript on the network with the FQDN in the path.
And what should I say: It worked...
To summarize again: FQDN / System Account --> Not Working
Servername / System Account --> Working
Store the File on the local File System / System Account --> Working
FQDN / Domain Account --> Working
Servername / Domain Account --> Working
FQDN / System Account / Started by a wrapper script --> Working
Possible Solutions: Using Server name only --> Not Possible because we want to get rid of NTLM and i want to get it working in other domains.
Using a domain account --> I don’t want, that the credentials are getting cached on the Server.
Using a local Wrapper script --> that’s not the idea of storing a script on a network device.
Can someone explain me, why this is happening?
################################## 10.03.25 22:45 Update:
In the Windows Powershell Log i found an Entry, that he is not executeing the Script because of the RemoteExecution Policy. It looks like he is ignoring my ExecutionPolicy Bypass parameter. I signed the Script and trusted the Certificate and it worked.
I still can not explain, why it is working with the Hostname instead of the fqdn. Because the Hostname alone should not be an trusted Location. The Sever itself is not in the Trusted Zones List. But the Domain (Incl. Wildcard) is.
LocalSystem
account is very limited.