Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
Monitoring
Samples

Configuring a Non-Privileged Account

To use a low-privileged account as the service account for ServiceControl, the following should be considered:

Access control on queues

The transport connection string used by ServiceControl must enable access to the following ServicControl queues:

  • particular.servicecontrol
  • particular.servicecontrol.errors
  • particular.servicecontrol.staging (ServiceControl version 1.6 and above)
  • particular.servicecontrol.timeouts
  • particular.servicecontrol.timeoutsdispatcher

In addition, the connection string must enable access to the configured audit and error queues and the corresponding forwarding queues. These are typical:

  • audit
  • error
  • error.log (optional)
  • audit.log (optional)

If the connection string does not provide appropriate rights, the service will fail to start.

Url namespace reservations

The account under which the ServiceControl instance is running requires URL namespace reservations for the hostname and ports used by the instance. The reservations can be managed using the ServiceControl Powershell commands or from the command line using netsh.exe. For example, to add url reservation for http:\\localhost:33333\ to LocalService account the following command can be used netsh http add urlacl url=http://localhost:33333/ user=LocalService listen=yes delegate=no.

For instructions on how to review and change the urls used by ServiceControl instance, refer to Changing the ServiceControl URI.

Filesystem paths

The service account running ServiceControl instance requires following filesystem level access rights:

PathRights
Executables (e.g. C:\Program Files (x86)\Particular Software\Particular.ServiceControl)Read
Logs (e.g. C:\ProgramData\Particular\ServiceControl\Particular.ServiceControl\Logs)Write
Database (e.g C:\ProgramData\Particular\ServiceControl\Particular.ServiceControl\DB)Write
Database volume (e.g. C:)Read Attributes

Performance counters

ServiceControl requires access to Windows performance counter infrastructure. As a result the service account needs to be a member of Performance Monitor Users group.

Testing the configuration

These methods confirm that the service account has sufficient rights:

  • Configure the ServiceControl Windows service to run under the custom service account, start it and check the log files.
  • Interactively run ServiceControl under the custom service account.

Method 1: Running the service as a non-privileged user

  1. Open Computer Management.
  2. Change the service account to the custom user, provide the password and apply the change. The account will be given "logon as a service" privilege.
  3. Start the service and confirm that it started.
  4. Examine the log file to ensure that the service is operating as expected. If the service does not start and the log file does not indicate the issue, try Method 2.

Method 2: Running the service interactively as a non-privileged user

To run the service this way, the custom service account must have rights to log on interactively on the computer.

  1. Log on to the computer with admin privileges.
  2. Switch to the appropriate domain and username.
  3. Issue the following command, entering the password when prompted:

For example

runas /user:MyDomain\MyTestUser cmd.exe

If the command returns the error below, then the user account cannot be tested this way without adjusting the login rights. Normally this only occurs if the computer is configured as a domain controller or the system administrator has restricted login access using group policies.

1385: Logon failure: the user has not been granted the requested logon type at this computer.

Once login rights are granted:

  1. Ensure that the service is stopped.
  2. From the command prompt running as the service account, change to the ServiceControl installation directory and run ServiceControl.exe with the --serviceName parameter. In the following example, the default name has been used. Check ServiceControl Management if unsure of the service name
  3. Examine the output and confirm that there are no critical errors.
  4. Shut down the console session.
  5. Start the service.
ServiceControl.exe --serviceName=Particular.ServiceControl