Switching from System context to User Context

  • Thread starter Thread starter kedar
  • Start date Start date
K

kedar

Hi,

We have a service which runs in system context( it starts before the user is
logged on), and this service needs to read and validate some files. This
does not work if the user removes permissions for system under security tab
of properties.

So we want to know how to change the service context to logged on user
context so that we will not have above mentioned issue.


will the setthreadtoken() work.

Any kind of information will be appreciated.

thanks,
Kedar.
 
kedar said:
Hi,

We have a service which runs in system context( it starts before the user
is logged on), and this service needs to read and validate some files.
This does not work if the user removes permissions for system under
security tab of properties.

How does it not work? Just consider having the wrong permissions a
validation failure.
So we want to know how to change the service context to logged on user
context so that we will not have above mentioned issue.

Which logged on user? What if the user doesn't log on in the normal sense?

You can either have the user run an application that communicates with your
service (this is the way to show service status on screen as well), or use
the username and password to create a logon session. There is some means
for becoming an arbitrary user (ssh and IIS do this for certificate-based
login, for example) but it doesn't give you access to network resources, and
possibly other protected resources as well.
 
Back
Top