I want to script an install where a service needs to be run as a user. I want to be able to specify the user.
Creating the user is easy through the NET USER /ADD command.
Specifying the user for the service can also be done: the SC CONFIG command allows this.
Now the missing link: granting the user the "Log on as a service" privilege as a logon right (SeServiceLogonRight). Is there a command for this? Or a simple script for PowerShell?
NtRightsroute, but I'm glad there is a Plan-B whenNtRightsmight become unavailable for one reason or another. – Jeroen Wiert Pluimers Apr 28 '14 at 19:26ntrights +r SeServiceLogonRight -u %USERNAME% -m \\%COMPUTERNAME%works, butwhoami /alldoesn't show any change.secpol.mscdoes show the change however, so I have accepted your answer. – Jeroen Wiert Pluimers Apr 28 '14 at 19:43whomai /all(with and without UAC token) list the right, butsecpol.mscdoes. – Jeroen Wiert Pluimers May 08 '14 at 19:10