MSDeploy RunCommand 权限
我尝试在 MSDeploy 中使用 -presync:runCommand 选项,无论我尝试运行什么,都会收到相同的错误:
错误:客户端不拥有所需的权限。
我尝试了一些要执行的项目,但没有一个起作用。理想情况下,我想在服务器上执行一个exe文件,如下所示:
-presync:runCommand=C:\MyExecutable.exe,dontUseCommandExe=true
我也尝试
-presync:runCommand=C:\TestScript.bat
过来自他们的示例 文档
-presync:runCommand="net stop w3svc"
提前致谢。
I am trying to use the -presync:runCommand option in MSDeploy and no matter what I try to run, I get the same error back:
Error: A required privilege is not held by the client.
I've tried a handful of items to execute, and none of them work. Ideally I want to execute an exe on the server as such:
-presync:runCommand=C:\MyExecutable.exe,dontUseCommandExe=true
I've also tried
-presync:runCommand=C:\TestScript.bat
And the sample from their documentation
-presync:runCommand="net stop w3svc"
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了答案,事实证明我已经完成了一半。在我在问题中提供的链接中,他们提到如何向 WMSvc 帐户添加权限,如下所示:
它没有提到的是您必须重新启动 WMSvc 才能生效。
I found the answer, and it turns out I had already halfway completed it. In the link I provided in my question, they mention how to add privileges to the WMSvc account, like so:
What it failed to mention is that you must restart WMSvc for this to take affect.
例如
Provider =“runCommand”
State = Enabled
Path =
Path Type = PathPrefix
Actions = *
Identity Type = SpecificUser
UserName = WDeployAdmin
(您需要知道密码,我没有,所以我更改了P/W)
然后“将用户添加到规则”为“*”并选中 IsRole
对提供者 =“contentPath”执行相同操作
按如下方式提升“WMSvc”权限...
sc privs wmsvc SeChangeNotifyPrivilege/SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege/SeIncreaseQuotaPrivilege
e.g.
Provider = "runCommand"
State = Enabled
Path =
Path Type = PathPrefix
Actions = *
Identity Type = SpecificUser
UserName = WDeployAdmin
(you'll need to know the password for this, I didn't so I changed the P/W)
Then "Add User To Rule" as "*" and IsRole checked
Do the same for provider = "contentPath"
Elevate the 'WMSvc' privilages as follows...
sc privs wmsvc SeChangeNotifyPrivilege/SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege/SeIncreaseQuotaPrivilege