DaveN59
DaveN59

Reputation: 3718

What account should I use when hosting WCF service in a Windows Service on Server 2008?

OK, it seems like a simple thing, but I'm unfamiliar with the various accounts and privileges / roles each has.

I want to host my WCF services in a Windows Service on Server 2008 R2, and to do that I need to create an installer class. In there, when I instantiate a new ServiceProcessInstaller I need to specify the Account used to run the service. Given the choices are LocalSystem, LocalService, NetworkService and User, I am inclined to pick LocalService. Is this the right choice?

This is an internal application providing database access and some business logic, available from anywhere on our intranet but not visible to the outside world, if that makes any difference.

Thanks in advance for your comments or references to where this question has already been addressed. Dave

Upvotes: 1

Views: 2387

Answers (1)

Ta01
Ta01

Reputation: 31630

Sometimes specific credentials are required if certain privileges are going to be executed by service operations that require authentication for file system locations etc, however if no such permissions are required, you should use Network Service.

The NetworkService account is a predefined local account used by the service control manager. It has minimum privileges on the local computer and acts as the computer on the network.

From Microsoft's example on hosting a WCF service in a Windows Service, they also use Network Service.

Upvotes: 1

Related Questions