command-line - 如何从命令行更改 Windows 服务的用户凭据?

标签 command-line windows-services

如何从命令行更改 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/

相关文章:

c++ - 允许低特权用户启动 Windows 服务

c# - wmic 通过 .NET 或 C#

c# - 是否可以创建一个 C# Windows 服务来检测 Windows XP 上的新文件创建?

mysql - 搜索文档内容的建议 - Windows Search 好用吗?简单的MySQL?

windows - Gradle命令行启动错误

bash - 从 url 运行 bash 脚本时如何获取用户输入?

mysql - 使用 .mwb 文件的命令行转发工程?

windows-services - PsExec 在非交互式运行时卡在许可证提示符上

c# - 如何在.NET 中安装 Windows 服务?

linux - 命令行日志文件中时间的分箱直方图