Using SC.exe to set service credentials password fails

后端 未结 8 1071
野性不改
野性不改 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:39

    To enable log on as a service via script I've written this, you can use it as is or pull out what is useful to you

    https://raw.githubusercontent.com/cdaf/windows/master/automation/provisioning/setServiceLogon.ps1

    0 讨论(0)
  • 2020-12-10 14:44

    Try to stop the service before setting up the password:

    sc.exe stop "<my_service>" 4:4:3
    sc.exe config "<my_service>" obj= "\.<local_acc_name>" password= "<local_acc_pass>"
    sc.exe start "<my_service>"
    
    0 讨论(0)
提交回复
热议问题