views:

161

answers:

1

i am new to windows services programming. I have confusion about what to set the Account type while writing a windows services.

how to choose or how to determine to which account type we need to set while writing a service.

+1  A: 

We generally create special windows (local for local only access or domain account for things that need to authenticate accross the network) accounts to run custom services. This way we can restrict and lock down the permissions to make sure it only has access to what we need. You can also see which specific users are culprits or resource hogging with monitoring on a shared server.

As for the built in accounts...

Local System: The built-in LocalSystem user account has a high level of access privileges; it is part of the Administrators group.

Network Service: The built-in Network Service user account has fewer access privileges on the system than the LocalSystem user account, but the Network Service user account is still able to interact throughout the network with the credentials of the computer account.

Local Service: The built-in Local Service user account has fewer access privileges on the computer than the Network Service user account, and those user privileges are limited to the local computer. Use the Local Service user account if the worker process does not require access outside the server on which it is running. Source(s): Microsoft Technet

Jay
Thanks Jay. Can you give some example senarios where we run the service in localservice account. Thank you.
The easiest thing would be to look in your PC's Services console...IN vista/XP its in Admin Tools - Services. From here you can sort on the "Logon On As" column and look for the types of services started for each account.A simple example of this is the UPnP detection service which hosts uPNP devices on your local PC. This service only requires limited access so Microsoft uses the "Local Service" account.
Jay