我需要为创建的IIS应用程序池设置日志文件夹的权限。设置权限的代码:
<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 2003上的IIS 6很好,但对于Windows Server 2008上的IIS 7.5则失败。我知道错误:
ExecSecureObjects: Error 0x80070534: failed to get sid for account: IIS AppPool\MyAppPool调查详情:
发布于 2016-04-25 15:06:31
当我将我的WIX项目构建为x86时,我遇到了这个问题。我解决了这个问题,我把SchedSecureObjects和ExecSecureObjects排在了ConfigureIIs之前。
<Custom Action="SchedSecureObjects" After="ConfigureIIs" />
<Custom Action="ExecSecureObjects" After="ConfigureIIs" />当我开始以x64的形式构建这个项目时,这个问题又出现了。这一次,我还必须在配置之前安排64位操作。
<Custom Action="SchedSecureObjects_x64" After="ConfigureIIs" />
<Custom Action="ExecSecureObjects_64" After="ConfigureIIs" />
<Custom Action="SchedSecureObjects" After="ConfigureIIs" />
<Custom Action="ExecSecureObjects" After="ConfigureIIs" />发布于 2013-04-27 06:18:32
在服务器2012上进行测试时,我确认在帐户可用之前可能会出现延迟。使用下面的脚本,我复制了大约30次尝试中的3次失败。在创建应用程序池和查找SID之间,我们似乎需要一个延迟。在我的测试中,它从来不超过1秒。
param ($id)
if (!$id) {write-host "specify an id"; return}
c:\windows\system32\inetsrv\appcmd add apppool /name:$id /managedRuntimeVersion:"v4.0" /managedPipelineMode:"Integrated"
$objUser = New-Object System.Security.Principal.NTAccount("IIS APPPOOL\$id")
$sid=""
while (!$sid)
{
$sid = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
if (!$sid) {write-host "$id not found"} else {$sid}
sleep 1
}https://stackoverflow.com/questions/13882802
复制相似问题