问题
I want to install a TeamCity BuildAgend as a user. When entering my user credentials here:
I always get this error:
NOTE: My account (user) is Administrator with full permission!
How can I do this?
回答1:
The error message says it does not have "enough rights to run as a service",
this is slightly different from just being an administrator.
- Go to Control Panel> Administrative Tools> Local Security Policy.
- Select Local Policies> User Rights Assignment.
- Scroll down through the list of policies and look for Log on as a service.
- Add the account you're using to the list of accounts with this right.
That should in theory be all you need to allow the service to run under that user.
回答2:
The best powershell command that I have found for this is:
Grant-Privilege -Identity $SERVICE_USERNAME -Privilege SeServiceLogonRight
Requires use of the Carbon framework.
回答3:
I'm a Windows 10 Home user and the steps above did not work for me, but the following did:
- Enable gpedit.msc by running the batch file as explained here under Method 1: https://www.askvg.com/how-to-enable-group-policy-editor-gpedit-msc-in-windows-7-home-premium-home-basic-and-starter-editions/
- Run gpedit.msc
- Go to Local Computer Policy / Computer Configuration / Windows Settings / Security Settings / Local Policies / User Rights Assignment
- Double-click Log on as a service
- On the window that appears, click Add User or Group...
- Enter your username and click the Check Names button
- Your name will be modified, adding the machine name as the prefix. Click OK
- Click OK on the Log on as a service Properties window to apply the change.
It is a little bit of a pain, but after doing that, I was able to continue installing TeamCity
来源:https://stackoverflow.com/questions/30718514/installing-teamcity-build-agent-as-a-user-failed-to-install-the-service-select