This is on Windows 2012 Server Datacenter
Have a windows task setup to run under a specific domain account.
Security options = Run whether the user is logged on or not and "run with highest privileges" checked. This account is also a local admin.
The task executes a powershell script that works fine when I invoke it manually
The task has 3 actions and are listed here:
Start a program powershell Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force Start a program powersehll .\myscript.ps1 Start a program powershell Set-ExecutionPolicy -ExecutionPolicy Restricted
This seemed to work fine when I setup this same task on another machine, as well as my own workstation. However, on this particular server, I get errors in the windows event log in pairs. One is an explicit entry that Im writing to the event log from within the powershell script within a try/catch, but the other is an error with EventID 1511 from the User Profile Service. "Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off."
The other error that I am logging is due to the webrequest, and its getting a http 401 error.
This account was setup as a domain service account. What could be causing this issue with the user profile? I suspect that since our domain controller is still on 2008, this might be related?