sc.exe config “Service Name” obj= “DOMAIN\User” password= “password” not working

前端 未结 4 1712
死守一世寂寞
死守一世寂寞 2020-12-31 10:27

I want to set password for a service from the cmd. I got the option

sc.exe config \"Service Name\" obj= \"DOMAIN\\User\" password= \"password\"

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 10:41

    The first thing to check is if that user has permission to Log On As A Service in that machine. If he does (and you can do the following procedure to check this), just go to the service (Start Menu - type "services", without the quotes). Find your service on the list, and right-click on it. Select "Properties", and go to the "Log On" tab. Retype the "Password" and "Confirm password". Click OK. If your user DOES have permission to Log On as a Service, a message "The account YourDomain\YourUser has been granted the Log On As a Service right". Just try to start the service again, and it will work.

    If your user does not have this kind of permission, you can use one of these two approaches:

    1) Start menu - type "local security policy" without the quotes. Open the "Local Policies", then left-click on "User Rights Assignment". On the right panel, right-click on "Log on as a service", and select "Properties". Click on "Add User or Group" and add your user. Click OK. You might have to reboot your machine.

    2) Download and install the "Windows Server 2003 Resource Kit Tools" (http://www.microsoft.com/en-us/download/confirmation.aspx?id=17657). Open a command prompt and type:

    ntrights +r SeServiceLogonRight -u MyDomain\MyUser -m \\%COMPUTERNAME%

    Reboot your computer and try to start the service again.

    After your user has been granted the Log On As A Service right, you can create and start services through the command line.

提交回复
热议问题