如何从命令行更改 Windows 服务的用户凭据?
最佳答案
sc.exe config "Service Name" obj= "DOMAIN\User" password= "password" type= own
见 Shortcut Setting Log-On Credentials for Windows Services » jonathanmalek.com .
@MattT 指出在 Windows Server 2008R2 上你必须添加
type= own
,但在该版本之前没有必要。在 PowerShell 3+ 中,您可以避免使用 stop-parsing symbol 转义参数。 :
--%
sc.exe --% config "Service Name" obj= "DOMAIN\User" password= "password" type= own
关于command-line - 如何从命令行更改 Windows 服务的用户凭据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/966389/