2010-12-07 45 views
17

我試圖使用-presync:runCommand選項MSDeploy和無論什麼我嘗試運行,我得到了同樣的錯誤回來:MSDeploy RunCommand特權時

Error: A required privilege is not held by the client.

我已經試過幾件作品執行,並沒有一個工作。理想我想在服務器上執行一個EXE這樣:

-presync:runCommand=C:\MyExecutable.exe,dontUseCommandExe=true 

我也事先嚐試

-presync:runCommand=C:\TestScript.bat 

和樣品從他們documentation

-presync:runCommand="net stop w3svc" 

感謝。

回答

42

我找到了答案,事實證明我已經完成了一半。在我在我的問題中提供的鏈接,他們提到如何將權限添加到WMSVC帳戶,就像這樣:

sc privs wmsvc SeChangeNotifyPrivilege/SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege/SeIncreaseQuotaPrivilege 

它所沒有提到的是,你必須重新啓動WMSVC此生效。

+1

謝謝@Luke!這節省了我很多時間! – kiteloop 2012-03-14 21:58:33