RE: How do I restrict access from starting/stopping services?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Nick,

Thanks for your feedback.

"act as part of the operating system" is not the access right setting on
service object. It is the privilege of an account. By default, only "Local
System" account is granted the privilege of "act as part of the operating
system", not any other user accounts. This privilege will only play role in
some other API calling, such as LogonUser API in Win2000.

While stop/start a service, it is the SERVICE_STOP and SERVICE_START access
rights setting on the service object(in DACL) that are used to control
which account can perform these 2 operations on service object. The
privilege does not play any role here.

Can you tell me what user group the account is in? The first reply I
provided can be used to modify the DACL of a service object to grant/deny
any account certain operation right(such as start/stop service). Sure, you
should run this code in any account in Administrators group. However, just
as "Vladimir (Windows SDK MVP)" pointed out, if the account you want to
deny access is in Administrators group, we are out of lucky, because this
account is in Administrators group, he can also write some other code to
change the DACL of service object again and grant himself SERVICE_STOP and
SERVICE_START access rights. The principle here is that the Administrators
group can do whatever he can on the machine. So if you want to restrict an
account in Administrators group, the makes sense way is removing it from
Administratros group and modify the service object DACL to restrict his
access rights.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Log on as a batch job
    ... Depending on the task you are trying to run, the account you use may need ... be a member of the local Administrators group on the PC. ... And the entire point of Logon as a Batch Job privilege is to ... My brief experiments suggest that running a scheduled task requires the user ...
    (microsoft.public.windowsxp.security_admin)
  • RE: How do I restrict access from starting/stopping services?
    ... And I wasn't saying "act as part of operating system" ... was a right on the service object, I realized it was a right on the user ... It is the privilege of an account. ... should run this code in any account in Administrators group. ...
    (microsoft.public.win32.programmer.kernel)
  • RE: How do I restrict access from starting/stopping services?
    ... What if I want to restrict a certain account ... in the builtin administrators group. ... which account can perform these 2 operations on service object. ... Microsoft Online Community Support ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Installing a Windows Service programmatically
    ... I believe there's a property in your Service object or ServiceInstaller or ... something that specifies which account the service should run under, ... lpServiceStartName and the password is empty as can be seen in the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Rid AD of Circular Group Membership
    ... and have use on members if it is used there. ... Administrators group is still intact), nor do they have empowerments over ... Admins is being used for by the 30+ can be delegated I(ex. ... The quess is each has an account and uses it, ...
    (microsoft.public.windows.group_policy)