Monday, July 28, 2014

Setting up IIS in Autounattend.xml for Windows Server 2012/Windows Server 2012 R2


I frequently need to build and tear down VMs and update and refresh them with patches etc. so I heavily rely on being able to use the Autounattend.xml to automate my Windows installations above and beyond the basic installation.  You can find a great deal of documentation on the various settings required for an Autounattend.xml file in the Unattend.chm file that is installed when you install the Windows ADK along with Windows System Image Manager.
One of the most needed features for me is having IIS pre-configured for me.  I was previously able to accomplish this readily with earlier releases of Windows Server such as Windows Server 2008 and Windows Server 2008 R2 but with the release of Windows Server 2012/Windows Server 2012 R2, I was always plagued with the following error message:




As it turns out, after doing a bit of extended research and testing, I determined that it was due to my inclusion of the following element:
<selection name="NetFx3ServerFeatures" state="true" />

<selection name="NetFx3" state="true" />


Unfortunately, for whatever reason, Microsoft chose to not include support for installing these features directly through the Autounattend.xml file. 

Therefore, these features can only be installed via the DISM command.  Once I disabled/removed these settings from my Autounattend.xml file, I ended up with the following package settings for Windows Server 2012:


<servicing>

        <package action="configure">

            <assemblyIdentity name="Microsoft-Windows-ServerCore-Package" version="6.2.9200.16384" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="" />

            <selection name="WirelessNetworking" state="true" />

            <selection name="Xps-Foundation-Xps-Viewer" state="true" />

            <selection name="TelnetClient" state="true" />

            <selection name="IIS-WebServerRole" state="true" />

            <selection name="IIS-WebServer" state="true" />

            <selection name="IIS-WebServerManagementTools" state="true" />

            <selection name="IIS-ManagementConsole" state="true" />

            <selection name="IIS-ManagementScriptingTools" state="true" />

            <selection name="ServerCore-FullServer" state="true" />

            <selection name="MicrosoftWindowsPowerShell" state="true" />

            <selection name="ServerCore-WOW64" state="true" />

            <selection name="NetFx4" state="true" />

            <selection name="NetFx4ServerFeatures" state="true" />

            <selection name="MicrosoftWindowsPowerShellISE" state="true" />

            <selection name="MicrosoftWindowsPowerShellRoot" state="true" />

            <selection name="Server-Gui-Mgmt" state="true" />

            <selection name="IIS-ApplicationDevelopment" state="true" />

            <selection name="IIS-ApplicationInit" state="true" />

            <selection name="IIS-ASPNET45" state="true" />

            <selection name="NetFx4Extended-ASPNET45" state="true" />

            <selection name="IIS-NetFxExtensibility" state="false" />

            <selection name="IIS-NetFxExtensibility45" state="true" />

            <selection name="IIS-Security" state="true" />

            <selection name="IIS-BasicAuthentication" state="true" />

            <selection name="IIS-WindowsAuthentication" state="true" />

            <selection name="IIS-RequestFiltering" state="true" />

            <selection name="IIS-ISAPIExtensions" state="true" />

            <selection name="IIS-ISAPIFilter" state="true" />

            <selection name="IIS-CommonHttpFeatures" state="true" />

            <selection name="IIS-DefaultDocument" state="true" />

            <selection name="IIS-ASP" state="true" />

            <selection name="IIS-Performance" state="true" />

            <selection name="IIS-HttpCompressionStatic" state="true" />

            <selection name="IIS-HealthAndDiagnostics" state="true" />

            <selection name="IIS-HttpLogging" state="true" />

            <selection name="IIS-HttpTracing" state="true" />

            <selection name="IIS-RequestMonitor" state="true" />

            <selection name="NetFx3ServerFeatures" state="false" />

            <selection name="NetFx3" state="false" />

            <selection name="IIS-ASPNET" state="false" />

        </package>

    </servicing>


The version number is slightly different for Windows Server 2012 R2, but all else is essentially the same:


<servicing>

        <package action="configure">

            <assemblyIdentity name="Microsoft-Windows-ServerCore-Package" version="6.3.9600.16384" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="" />

            <selection name="WirelessNetworking" state="true" />

            <selection name="Xps-Foundation-Xps-Viewer" state="true" />

            <selection name="TelnetClient" state="true" />

            <selection name="IIS-WebServerRole" state="true" />

            <selection name="IIS-WebServer" state="true" />

            <selection name="IIS-WebServerManagementTools" state="true" />

            <selection name="IIS-ManagementConsole" state="true" />

            <selection name="IIS-ManagementScriptingTools" state="true" />

            <selection name="ServerCore-FullServer" state="true" />

            <selection name="MicrosoftWindowsPowerShell" state="true" />

            <selection name="ServerCore-WOW64" state="true" />

            <selection name="NetFx4" state="true" />

            <selection name="NetFx4ServerFeatures" state="true" />

            <selection name="MicrosoftWindowsPowerShellISE" state="true" />

            <selection name="MicrosoftWindowsPowerShellRoot" state="true" />

            <selection name="Server-Gui-Mgmt" state="true" />

            <selection name="IIS-ApplicationDevelopment" state="true" />

            <selection name="IIS-ApplicationInit" state="true" />

            <selection name="IIS-ASPNET45" state="true" />

            <selection name="NetFx4Extended-ASPNET45" state="true" />

            <selection name="IIS-NetFxExtensibility" state="false" />

            <selection name="IIS-NetFxExtensibility45" state="true" />

            <selection name="IIS-Security" state="true" />

            <selection name="IIS-BasicAuthentication" state="true" />

            <selection name="IIS-WindowsAuthentication" state="true" />

            <selection name="IIS-RequestFiltering" state="true" />

            <selection name="IIS-ISAPIExtensions" state="true" />

            <selection name="IIS-ISAPIFilter" state="true" />

            <selection name="IIS-CommonHttpFeatures" state="true" />

            <selection name="IIS-DefaultDocument" state="true" />

            <selection name="IIS-ASP" state="true" />

            <selection name="IIS-Performance" state="true" />

            <selection name="IIS-HttpCompressionStatic" state="true" />

            <selection name="IIS-HealthAndDiagnostics" state="true" />

            <selection name="IIS-HttpLogging" state="true" />

            <selection name="IIS-HttpTracing" state="true" />

            <selection name="IIS-RequestMonitor" state="true" />

            <selection name="NetFx3ServerFeatures" state="false" />

            <selection name="NetFx3" state="false" />

            <selection name="IIS-ASPNET" state="false" />

        </package>

    </servicing>

No comments:

Post a Comment