Using SC.exe to set service credentials password fails

后端 未结 8 1078
野性不改
野性不改 2020-12-10 14:05

I know this question has been asked in the past, but a satisfactory answer has not been provided.

I am using the SC command to config the credentials for a service.<

8条回答
  •  温柔的废话
    2020-12-10 14:33

    Besides stopping the service before making the changes, and granting the user permission to logon as a service, I also had to add the type= own parameter, otherwise it would fail with:

    [SC] ChangeServiceConfig FAILED 87:
    
    The parameter is incorrect
    

    So this is the command that worked:

    SC.EXE config "ServiceName" type= own obj= "domain\user" password= "password"
    

    It even worked with special characters in the password, given I had the password between double brackets.

提交回复
热议问题