.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/

相关文章:

c# - C# 在内存中表示负整数并将其强制转换为未经检查的方式

c# - Debugger.Launch() 不工作

installation - 如何在 dbpedia 端点的预定义命名空间前缀中添加前缀

mysql - 在 Windows Server 上配置 wamp 服务器?

.net - 简单线程速成类?

c# - XML-RPC.NET 和 C# 动态类型

windows-services - Windows 服务还是托盘/NotifyIcon?

c# - 优化用于发送 HTTP 请求的 Windows 服务

ubuntu - 构建 LLVM 3.4 和 clang 时出错

.net - 使用 GitLab CI Pipeline 构建 .NET 解决方案