MSDeploy RunCommand 权限

发布于 2024-10-06 15:43:36 字数 543 浏览 5 评论 0原文

我尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

这样的小城市 2024-10-13 15:43:36

我找到了答案,事实证明我已经完成了一半。在我在问题中提供的链接中,他们提到如何向 WMSvc 帐户添加权限,如下所示:

sc privs wmsvc SeChangeNotifyPrivilege/SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege/SeIncreaseQuotaPrivilege

它没有提到的是您必须重新启动 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:

sc privs wmsvc SeChangeNotifyPrivilege/SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege/SeIncreaseQuotaPrivilege

What it failed to mention is that you must restart WMSvc for this to take affect.

呆头 2024-10-13 15:43:36
  1. 在 Microsoft 服务委派中为在 WWWROOT 之外执行的任何操作(例如自定义文件夹)配置规则
    例如
    Provider =“runCommand”

State = Enabled

Path =

Path Type = PathPrefix

Actions = *

Identity Type = SpecificUser

UserName = WDeployAdmin

(您需要知道密码,我没有,所以我更改了P/W)

然后“将用户添加到规则”为“*”并选中 IsRole

  1. 对提供者 =“contentPath”执行相同操作

  2. 按如下方式提升“WMSvc”权限...

sc privs wmsvc SeChangeNotifyPrivilege/SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege/SeIncreaseQuotaPrivilege

  1. 重新启动“WMSvc”
  1. Configure your rules in Microsoft Service Delegation for any operations that are performed out of WWWROOT such as custom folders
    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

  1. Do the same for provider = "contentPath"

  2. Elevate the 'WMSvc' privilages as follows...

sc privs wmsvc SeChangeNotifyPrivilege/SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege/SeIncreaseQuotaPrivilege

  1. Restart 'WMSvc'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文