I am trying to schedule a task in Vista to run as a specified local "service account" user. I get the error:
"A specified logon session does not exist. It may already have been terminated."
I have tried the command line (schtasks.exe) as well as the GUI. (In elevated command prompt)
I am simply scheduling a batch file "C:\Scripts\Test1.bat" to run daily and to run as "testadmin" who is a member of the Administrators group. I am specifying the option "Run Whether User is Logged on or not". No matter what I do, I always get the above error.
The only account I have been successful in creating a task for is "SYSTEM".
Is there some local system policy preventing accounts other than SYSTEM to run a scheduled task?
I found the problem to this. As I suspected, it was a GPO setting.
We disable the "Allow user to save server credentials" setting. We were having problems where PC support staff would go to help a user, try to get into a privileged area, get challenged, then enter their own administrator credentials, and check the "Save Password" box. From that point on, the user would have elevated rights when accessing that server. It's actually kind of interesting how we found out about the problem. basically users were complaining "my banner page on the printer has an administrator as the name instead of mine".
Anyway...unfortunately, Vista's task scheduler now uses this facility to store the Runas password for the Runas account (which I find a little odd, because the Save credentials thing is part of the logged-in user's profile).