I have a scheduled task with these properties:
User account to run the task: A Service account that has logon as batch file privileges
Run whether user is logged on or not is enabled
Run with highest privileges is enabled
Configured for Windows Server 2012 R2
Trigger: Runs hourly
- Program/script: Powershell.exe
- Arguments: -command "Start-Process C:\Build.bat -Verb runas"
Now the problem I am having is that even though I have set the task to run whether user is logged on or not, it never completes unless the user is actually logged on. If it I log out, the task starts and it gets to about 95% done and then it just gets stuck. I've tested this theory several times and this is always the case. I'm confused as to why it's not working. The service account has local administrative permissions on this VM too. I'm using PoweShell because I want the script to run a command prompt as administrator.
Thank you in advance!