Re: How to run as in a deamon



If you want to impersonate them, you will need their credentials, and
use LoginUser. Perhaps save them away somewhere using the crypto API.
There is trouble there then when their password changes and you could
end up locking out their account.

There is nothing like being able to su from root to another user
without a password in Windows as far as I know.

ASP.NET is not a daemon, it is a filter, IIS is a daemon. I am not sure
how one schedules things in IIS though since it only comes to life when
a connection is made.

I am thinking that impersonation may not be an option and whatever API
you are calling on schedule, on behalf of the user, may have to trust
the caller, the scheduler program, and also accept a parameter that
indicates the user and use that to audit which actions are taken.

It would be nice if something like queued components could remember the
original callers id and execute as them on schedule.

The bottom line is that impersonation is a pain and more so when you
want to do it forever.

.