如何从命令行更改 Windows 服务的用户凭据? [英] How to change user credentials of windows service from command line?
本文介绍了如何从命令行更改 Windows 服务的用户凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从命令行更改 Windows 服务的用户凭据?
How to change user credentials of windows service from command line?
推荐答案
sc.exe config "Service Name" obj= "DOMAINUser" password= "password" type= own
见 Windows 服务的快捷方式设置登录凭据 » jonathanmalek.com.
@MattT 指出,在 Windows Server 2008R2 上,您必须添加 type= own
,但在该版本之前没有必要.
@MattT points out that on Windows Server 2008R2 you have to add type= own
, but prior to that version it isn't necessary.
在 PowerShell 3+ 中,您可以避免使用 停止解析符号:--%
In PowerShell 3+, you can avoid escaping the arguments with the stop-parsing symbol: --%
sc.exe --% config "Service Name" obj= "DOMAINUser" password= "password" type= own
这篇关于如何从命令行更改 Windows 服务的用户凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文