<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[gOxiA=苏繁=SuFan Blog]]></title> 
<link>https://maytide.net/index.php</link> 
<description><![CDATA[gOxiA,苏繁,sufan,Microsoft MVP]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[gOxiA=苏繁=SuFan Blog]]></copyright>
<item>
<link>https://maytide.net/read.php/1726.htm</link>
<title><![CDATA[[SBS] Windows Server 2012 Essentialse 因执行 SFC 引发的 RWA 访问故障]]></title> 
<author>gOxiA &lt;sufan_cn@msn.com&gt;</author>
<category><![CDATA[Windows Server]]></category>
<pubDate>Wed, 07 May 2014 07:51:38 +0000</pubDate> 
<guid>https://maytide.net/read.php/1726.htm</guid> 
<description>
<![CDATA[ 
	<p><a href="http://goxia.maytide.net/ftpupfiles/SBS_C647/logo_winserver2012_thumb1.png"><img title="logo_winserver2012_thumb[1]" border="0" alt="logo_winserver2012_thumb[1]" src="http://goxia.maytide.net/ftpupfiles/SBS_C647/logo_winserver2012_thumb1_thumb.png" width="220" height="44"></a></p> <p><strong><font color="#fd3f0d" size="4">Windows Server 2012 Essentials 因执行 SFC 引发的 RWA 访问故障</font></strong></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;前端时间在测试 RDS，所以在现有生产环境内部署了一台 RDS，访问都很正常，计划将其发布到外网已方便从 Internet 上直接访问，所以需要 RDG（Remote Desktop Gateway），而当前环境下的域控是基于 Windows Server 2012 Essentials（WS2012Ess）的，默认启用了 RWA，也就能够提供 RDG 的角色。</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当在 RDS 上添加这台 WS2012Ess 作为 RDG 时遇到了错误，提示“无法执行操作，因为操作 ResetRunspaceState无效……”，排错无果向 MSFT 提交了 Case，具体细节不再叙述，只提重点！按工程师的建议对 WS2012Ess 执行了dism /online /cleanup-image /checkhealth、/scanhealth、/restorehealth，以及 sfc /scannow 检查和修复的操作，当时也确实发现了问题并得到了修复，最后在此配置 RDS 便成功了。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/ac299403774c_D5B0/Screenshot_2014-04-12-00-08-37.png"><img title="Screenshot_2014-04-12-00-08-37" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Screenshot_2014-04-12-00-08-37" src="http://goxia.maytide.net/ftpupfiles/ac299403774c_D5B0/Screenshot_2014-04-12-00-08-37_thumb.png" width="634" height="358"></a></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RDS 是好了，但没想到 RWA 又出了故障，第二天才发现用户在访问 RWA 时报错“<strong><font style="background-color: #ffff00">未能加载文件或程序集 WSSg.Web.Internal, Version=6.2.0.0, Culture=neutral, PublickKeyToken=31bf3856ad364e35 或它的某一个依赖项。系统找不到指定的文件</font></strong>”。 </p> <p><a href="http://goxia.maytide.net/ftpupfiles/ac299403774c_D5B0/ESS1.png"><img title="ESS1" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="ESS1" src="http://goxia.maytide.net/ftpupfiles/ac299403774c_D5B0/ESS1_thumb.png" width="634" height="476"></a></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用 WS2012Ess 仪表板对 RWA 进行了修复，但总是失败！只得求助搜索引擎，没想到这个问题还真的有解，并且还是已知问题。</p> <p><a href="http://goxia.maytide.net/ftpupfiles/ac299403774c_D5B0/ess2.png"><img title="ess2" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="ess2" src="http://goxia.maytide.net/ftpupfiles/ac299403774c_D5B0/ess2_thumb.png" width="634" height="476"></a></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://support.microsoft.com/kb/2828269" target="_blank">KB2828269</a> 描述了这一问题，并提供了解决方案，只需执行如下 PowerShell 命令行即可。</p> <p><div class="code">$BinDir = &#91;System.Environment&#93;::ExpandEnvironmentVariables(&quot;%programfiles%&#92;windows server&#92;bin&quot;)</div></p> <p><div class="code">$WebDir = &#91;System.Environment&#93;::ExpandEnvironmentVariables(&quot;%programfiles%&#92;windows server&#92;bin&#92;WebApps&quot;)</div></p> <p><div class="code">$WebDir = get-childitem $WebDir –recurse</div></p> <p><div class="code">$List = $WebDir &#124; where &#123;$_.name -eq &quot;web.config&quot;&#125;</div></p> <p><div class="code">foreach($listItem in $List)&#123; if($listItem.DirectoryName -match &quot;MacWebService&quot;) &#123;continue;&#125; ($a= Get-Content $listItem.FullName); $a = $a -replace &quot;%SBSPRODUCTBINPLACEHOLDER%&quot;, $BinDir; remove-item $listItem.FullName; $f = &#91;io.path&#93;::Combine($listItem.DirectoryName, &quot;Web.config&quot;); $a &gt;&gt; $f&#125;</div></p>
]]>
</description>
</item>
</channel>
</rss>