Restart a NT service with non-administrator rights? 
Author Message
 Restart a NT service with non-administrator rights?

I've created a NT service which should be restarted
via the menu in my application. If I restart the service
as administrator or as user with administrator rights it
works. What can I do that a normal user can restart my
service, too? Is there in NT an equivalent to setuid/setgid
in Unix?

Regards,

Torsten



Mon, 09 Jul 2001 03:00:00 GMT  
 Restart a NT service with non-administrator rights?
I'm not sure if starting a service requires you to have admin privilages
or not, but is sure sounds like it must.  I assume you are opening the
service control manager and telling it to start the service?  If you
really do need admin privilages, check out the following functions:

LogonUser();   // allows you login a user; need user name and password
ImpersonateLoggonOnUser(); // allows the program to run using the
security context of the given user (use the handle returned from
LogonUser())
RevertToSelf(); // program goes back to original security context.

These may help you out.
--

~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
~ Tim Morgan
~ Programmer/Analyst
~ Envoy Global, Inc.  *Internet Conferencing Solutions*

~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Quote:

> I've created a NT service which should be restarted
> via the menu in my application. If I restart the service
> as administrator or as user with administrator rights it
> works. What can I do that a normal user can restart my
> service, too? Is there in NT an equivalent to setuid/setgid
> in Unix?

> Regards,

> Torsten



Tue, 10 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Closing a service on a NT PC when using an non administrator account

2. NT Services Restart Problem

3. **Automatically** restarting an NT Service

4. Processes spawned by service *lock* the socket port if service is restarted

5. Remote startup of NT Services from another NT Service

6. Are administrator rights needed to register a COM ?

7. giving a Win32 application Administrator rights on Windows 2000

8. Install controls as non Administrator?

9. Using embedded C++ under non-administrator account.

10. RegCreateKeyEx() and non-administrators

11. Determine whether a user is an Administrator from a Service

12. administrators in Windows 2000-NT, 2nd part

 

 
Powered by phpBB® Forum Software