March 3rd, 2008

Why does scheduling a task require a password?

Kevin asks, “Windows XP lets me install applications, delete files, etc., so why does scheduling a task requires a password?” (I guess the answer to this question wasn’t obvious since nobody answered it in the suggestion box.) Because scheduled tasks run after you have logged off. All those other operations occur while you are logged on. Your user token has been authenticated with the relevant security authority. The system has confirmed your identity and your permissions and stored them in your user token. But once you log off, your token goes away.

Since scheduled tasks can run even if you aren’t logged on (that’s sort of the point of them after all), the system needs to re-establish your identity and your permissions, because your account may have been deleted or restricted in the meantime. And to do that, you need a password. Scheduled tasks can’t use some “just act like I’m that user over there, trust me” magic cookie, because that would be equivalent to a password.

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.