I'm in the process of standing up a Windows Server 2019 system primarily used for running scripts via task scheduler. The scripts that have been working on the 2016 2012 servers before it no longer work on the new server. I have written simple scripts to see what specifically is not working and was wondering if anyone has seen this before.
test-wsman $DFSIPADDRESS | tee-object -variable test | out-file errortest.log
$test | out-file \\$DFSIPADDRESS\my\personal\share\wsmantest.log
$error | out-file errortest.log
The error output indicates that the user "has not been granted the requested logon type at this computer." for the out-file to the DFS. If I run the same script as the user in ISE it works fine. If I run the script through task scheduler but require the user to be logged in it also works.
The user is a domain user and in the local admin group. I have verified log on as a batch for the user.
I have verified batch logon. It's as if the user is not getting domain access when the script is run via task scheduler, but does still have local admin rights.
any thoughts would be very appreciated.
Log on as a batch job
? In addition to that, you should the absolute path where the files are going to be saved to avoid further errors. - Santiago Squarzon