473,748 Members | 10,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Service Permissions...

The application I am currently working on contains a custom windows service.

On my machine, when I logon with a domain user (non-admin) account, the user
is unable to control (start and stop) the service (an access denied message
is displayed). On another machine, the same user is able to control this
service. This leads me to believe that this is being caused by one or more
permission settings (or lack of).

The first question...what permission settings do I need to give to a user
(non-admin) account to allow them to control this service?

The second question...is it possible to give the user permission to control
my custom service but to not control all other (system) services or is it an
all-or-nothing situation? I would like the user to be able to start and stop
the service that I created but not other system-type services.

Thank you,

Jason Richmeier
May 15 '06 #1
5 8302
Jason Richmeier wrote:
The application I am currently working on contains a custom windows service. The first question...what permission settings do I need to give to a user
(non-admin) account to allow them to control this service?


The key question is what resources does the application(ser ver) use.

The service is basically an automated user -- who has same privileges as
the user account under which it runs.

If you need it to read a file, then the account it runs under needs to
have permission to read the file.

If it has to go out on the network, and grab files, then the account has
to have permission to access the network shares.

And so on....
May 15 '06 #2
I apologize if the question was a little vague.

The service is running using the local system account so it has enough
permissions to do the work it needs to do. What I am really after is what
permissions does a user logged in to the machine that the service is running
on need to be able to start and stop the service using the service control
manager.

"John A. Bailo" wrote:
Jason Richmeier wrote:
The application I am currently working on contains a custom windows service.

The first question...what permission settings do I need to give to a user
(non-admin) account to allow them to control this service?


The key question is what resources does the application(ser ver) use.

The service is basically an automated user -- who has same privileges as
the user account under which it runs.

If you need it to read a file, then the account it runs under needs to
have permission to read the file.

If it has to go out on the network, and grab files, then the account has
to have permission to access the network shares.

And so on....

May 16 '06 #3
Hi Jason,

I believe that running a Windows service with the Local System is
something that is not recommended at all, from a Security point of
view.

If you want the user to be able to interact with the service, you
should consider using a custom user account.

May 16 '06 #4
I am not sure I completely understand your second point.

Regardless of the account I set the service to run under (set either when
the service is deployed and installed or through the service's properties),
the currently logged on user cannot start and stop my service (or any other
service for that matter) on my machine. If I install my service on another
machine, the same user logged on to that machine can start and stop my
service. This leads me to believe it is a local setting of some sort. I am
trying to figure out what settings I need to make to allow a user to start
and stop my service on my machine. Ideally, I would like for the user to be
able to start and stop my service only (so that they are not starting and
stopping critical system services).

Thank you,

Jason Richmeier

"Cerebrus" wrote:
Hi Jason,

I believe that running a Windows service with the Local System is
something that is not recommended at all, from a Security point of
view.

If you want the user to be able to interact with the service, you
should consider using a custom user account.

May 16 '06 #5
Hi Jason,

Thanks for your post!

The Service security and access right is documented in the MSDN link below:
"Service Security and Access Rights"
http://msdn.microsoft.com/library/de...us/dllproc/bas
e/service_securit y_and_access_ri ghts.asp

1. As we can see in the link: "Only processes with Administrator privileges
are able to open handles to the SCM that can be used by the CreateService
and LockServiceData base functions.", so only Administrators can create the
service.

2. The key point you are after is listed in the bottom of the MSDN link:
"The default security descriptor of a service object grants the following
access". As we can see, service object only grants SERVICE_START and
SERVICE_STOP permission to Administrators and LocalSystem accounts. Local
authenticated users (including LocalService and NetworkService) can only
have read permission over the service.

So the answer to your question is: only Administrators group or LocalSystem
account processes can manipulate the services installed on the machine.

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

May 17 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2591
by: cd | last post by:
Is there a specific process or permissions that must be granted to get a .NET (framework 1.4) Window Service to run properly on a Windows 2003 Server? I built a Windows Service to start two local programs (Putty and Pageant) located on a Win 2003 Server. The service installs but doesn't start the Putty / Pageant programs properly when using any user ID except my own. Why will it work with my User ID? I install the Windows Service on a Win...
1
2312
by: Simon Chester | last post by:
Hello! Can anyone help me with this problem?... I have developed an ASP.NET (version 1.1) application which I have deployed to a number of webservers. The web application works fine on Windows 2000 Server computers. It also works OK on Windows 2003 Server UNTIL Windows 2003 Service Pack 1 is installed! The error and stack trace I am given is:
4
2226
by: Bala | last post by:
Hi, After installing Win2K3 SP1, ASP.NET pages are not being rendered at all. I get a Access Denied error (BC31019: Unable to write to output file) OR a Page Cannot Be Displayed (PCBD) error with no errors reported in the Event log. Is there a known issue with SP1 that will break ASP.NET application/ does not render ASP.NET at all? My server admin demands the server to have SP1 but I do not know of any security tweaks that need to be
10
3489
by: Ger | last post by:
I am having problems using VB.Net's Management base object on a machine hosting Windows Server 2003. I am trying to set file permissions from a Windows Service. These files may be loacted on a local machine or somewhere on the network. I use the Management Base Object to set these permissions which works perfectly when the windows service is running on an XP machine. However, when the service is running on a Windows Server 2003 machine I...
27
4721
by: pisquem | last post by:
I am building an windows service that is to be deployed on a windows server 2003 and I want to have activity written to the event log, I want its own log called ('CustomLog') Below is what I have so far...its builds fine but when I go to start the service i get the following error. --------------------------- Services ---------------------------
3
1900
by: Tom | last post by:
Is it possible to access (Read via StreamReader) an external file from a Wndows service? I.E. In the OnStart method of the service, I need to go out and read a couple of external files (and these files appear on a differnet server and are accessed via a UNC syntax - i.e. \\server\share\myfile.txt). I tried this under my VB.NET service but it keeps telling me that I have an unauthorized file access when my service starts up) Thanks.
10
4454
by: dermot | last post by:
I have wrriten a small windows service application in visual studio ..net 2003 which listens for incoming FTP files. These files would overwrite over time due to duplicate file names. However any time the windows service tries to rename the file (using flFile.move(source,destination)) it gets an error saying access is denied. The files are on the network, so we though the local system account may not have access We tried changing the...
3
1749
by: Derek Hart | last post by:
As a newbie to Windows Service programming in VB.Net, I need some clarification. I am writing a Windows Service that works with SQL Server. It works fine as a console application, but when I run it as a service it is having problems. I want to be able to debug it, so I placed this code in the OnStart routine which allows me to break into the code: System.Diagnostics.Debugger.Launch() System.Diagnostics.Debugger.Break() It looks like...
41
11657
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it exits immediately with a start/stop/nothing to do error. What could be wrong?
3
1895
by: Matt Lowrance | last post by:
I'm hoping someone can give me a little guidance. I have written a simple Windows Service that goes out and scrapes a few web pages and updates some data in an access database. The service works correctly in the IDE and trying to be a good citizen I set it to run as "Local Service" when I install it. However once installed it fails silently. My log eventlog message saying the the DB was updated successfully is written, however the...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8242
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.