我需要为创建的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)。不幸的是,这并没有帮助。
同样的问题在这里寻找解决方案。 –