我需要爲創建的IIS應用程序池的日誌文件夾設置權限。該代碼設置權限:爲新創建的IIS AppPool身份設置的權限
<CreateFolder Directory="SiteLogsFolder">
<util:PermissionEx User="Everyone" Read="yes" GenericRead="yes"/>
<util:PermissionEx User="[IisSiteUser]" GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" DeleteChild="yes"/>
</CreateFolder>
<CustomAction Id="SetIis6SiteUser" Property="IisSiteUser" Value="NT AUTHORITY\NetworkService"/>
<CustomAction Id="SetIis7SiteUser" Property="IisSiteUser" Value="IIS AppPool\[SITE_APP_POOL]"/>
<InstallExecuteSequence>
<Custom Action="SetIis7SiteUser" Before="InstallInitialize">IISMAJORVERSION>="#7"</Custom>
<Custom Action="SetIis6SiteUser" Before="InstallInitialize">IISMAJORVERSION="#6"</Custom>
</InstallExecuteSequence>
這個Windows Server 2008上的Windows Server 2003上正常工作對IIS 6,但失敗了IIS 7.5我得到的錯誤:
ExecSecureObjects: Error 0x80070534: failed to get sid for account: IIS AppPool\MyAppPool
調查的詳細信息:
- 我也試過「IIS APPPOOL」域 - 相同的結果。
- 還嘗試設置PermissionEx元素的域和用戶屬性,而不是將它們合併到用戶屬性中。同樣的錯誤。
- 在PermissionEx中使用活動目錄帳戶可以正常工作。當設置時,活動目錄帳戶也可以與IIS站點池一起正常工作。
- 如果我嘗試設置另一個AppPool的權限(而不是由我的安裝程序創建一個,例如IIS AppPool \ DefaultAppPool),再次正常工作。只有當我爲我的安裝程序創建的AppPool設置權限時纔會出現問題。
- 我檢查了ConfigureIIs,SchedSecureObjects和ExecSecureObjects的排序,並嘗試強制ConfigureIIs在另外兩個之前執行(建議in this thread)。不幸的是,這並沒有幫助。
同樣的問題在這裏尋找解決方案。 –