The web configuration file may become corrupted when you run the SFC command in Windows Server 2012 Essentials

Article ID: 2828269 - View products that this article applies to.
Expand all | Collapse all

Symptoms

When you run the SFC (system file checker) command together with the /scannow option in Windows Server 2012 Essentials, the Remote Web Access feature may break. 

Additionally, the web configuration file may become corrupted. Specifically, the string "%SBSPRODUCTBINPLACEHOLDER%" is displayed in the Web.config file in the following folder:
X:\Program Files\Windows Server\Bin\WebApps\Site

Note In this folder name, the placeholder X represents the label for the system volume.

Cause

When you run the SFC command together with the /scannow option, some critical changes that were applied during the server installation could revert.

Resolution

To resolve this issue, run the following Windows PowerShell commands as an administrator. Run each command separately and in the following order:
  1. $BinDir = [System.Environment]::ExpandEnvironmentVariables("%programfiles%\windows server\bin")
  2. $WebDir = [System.Environment]::ExpandEnvironmentVariables("%programfiles%\windows server\bin\WebApps")
  3. $WebDir = get-childitem $WebDir –recurse
  4. $List = $WebDir | where {$_.name -eq "web.config"}
  5. foreach($listItem in $List){ if($listItem.DirectoryName -match "MacWebService") {continue;} ($a= Get-Content $listItem.FullName); $a = $a -replace "%SBSPRODUCTBINPLACEHOLDER%", $BinDir; remove-item $listItem.FullName; $f = [io.path]::Combine($listItem.DirectoryName, "Web.config"); $a >> $f}

Properties

Article ID: 2828269 - Last Review: April 3, 2013 - Revision: 6.0
Applies to
  • Windows Server 2012 Essentials
Keywords: 
KB2828269

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com