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?