.net - 使用InstallUtil并静默设置Windows服务登录用户名/密码

标签 .net windows-services installation windows-installer

我需要使用InstallUtil来安装C# Windows服务。我需要设置服务登录凭据(用户名和密码)。这一切都需要默默地完成。

有没有办法做这样的事情:

installutil.exe myservice.exe /customarg1=username /customarg2=password

最佳答案

比上面的帖子更简单的方法并且在安装程序中不需要额外的代码是使用以下内容:

installUtil.exe /username=domain\username /password=password /unattended C:\My.exe

只需确保您使用的帐户有效即可。如果没有,您将收到“帐户名称和安全 ID 之间未完成映射”异常

关于.net - 使用InstallUtil并静默设置Windows服务登录用户名/密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/140054/

相关文章:

php - 在 Linux 中将 PHP 和 MySQL 安装为服务

python - 在 Unix 中为 Python 安装命名以及 shebang 的良好使用

c# - 如何通过几个点绘制贝塞尔曲线?

.net - 前导 '.' 或 '! ' 只能出现在 'with' 语句内

c# - WCF net.tcp - 连接被目标机器拒绝

c# - Windows 服务计划每天在 6 :00 AM 运行一次

c# - 调用时SSIS包将不会执行

c# - 如何在一个解决方案中的项目之间使用共享资源文件?

c# - HttpClient 的 ReadWriteTimeout 替代方案是什么

python - 错误: command 'cc' failed with exit status 1 on Mac for pip install MySQL-python