MSDeploy RunCommand Priviliges

2019-02-01 08:33发布

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.

标签: msdeploy
1条回答
虎瘦雄心在
2楼-- · 2019-02-01 09:02

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.

查看更多
登录 后发表回答