Using unattend.xml answer file to install IIS during Sysprep.

Posted on 2011-05-13
Last Modified: 2012-05-11
I think this should be easy to accomplish but I haven't been able to make it work.  Previously my master VMs that I capture the Windows 7 images out of had IIS installed on them prior to Sysprep and deployment but the default profile was not being created.  I finally figured out that IIS being pre-installed is why the copy profile option wasn't working for me.  If anyone wants to know about that just ask.  I uninstalled IIS from the master image and configured my answer file to install it during sysprep (copy profile works once the iis user profile was deleted).  That didn't work on the old image so I figured it was because IIS was formerly present.  No big deal I created a fresh Windows 7 Pro x86 image that IIS has never been installed on.  I installed no updates, no special software, basically nothing on the VM and syspreped it with my new answer file.

After the reboot everything from my answer file works fine but IIS is not installed.  I've looked at the log files in C:\windows\panther and C:\Windows\System32\sysprep and I don't see anything about IIS being installed, or failing.

Have any of you made this work before?  Or is there maybe another log file somewhere I'm not looking at?  This is the packages section of my answer file that the AIK creates.

        <package action="configure">
            <assemblyIdentity name="Microsoft-Windows-Foundation-Package" version="6.1.7600.16385" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="" />
            <selection name="IIS-WebServerRole" state="true" />
            <selection name="IIS-ManagementConsole" state="true" />
            <selection name="IIS-ApplicationDevelopment" state="true" />
            <selection name="IIS-NetFxExtensibility" state="true" />
            <selection name="IIS-ASPNET" state="true" />
            <selection name="IIS-ISAPIExtensions" state="true" />
            <selection name="IIS-ISAPIFilter" state="true" />
            <selection name="IIS-DefaultDocument" state="true" />
            <selection name="IIS-CommonHttpFeatures" state="true" />
            <selection name="IIS-DirectoryBrowsing" state="true" />
            <selection name="IIS-HttpErrors" state="true" />
            <selection name="IIS-StaticContent" state="true" />
            <selection name="IIS-HealthAndDiagnostics" state="true" />
            <selection name="IIS-HttpLogging" state="true" />
            <selection name="IIS-RequestMonitor" state="true" />
            <selection name="IIS-HttpCompressionStatic" state="true" />
            <selection name="IIS-RequestFiltering" state="true" />
            <selection name="IIS-ManagementScriptingTools" state="true" />
            <selection name="IIS-ManagementService" state="true" />
            <selection name="IIS-ASP" state="true" />
            <selection name="IIS-CGI" state="true" />
            <selection name="MSMQ-HTTP" state="true" />
            <selection name="WCF-HTTP-Activation" state="true" />
            <selection name="IIS-WebServer" state="true" />
            <selection name="IIS-WebServerManagementTools" state="true" />
            <selection name="IIS-HostableWebCore" state="false" />
            <selection name="IIS-Security" state="true" />
            <selection name="IIS-Performance" state="true" />
            <selection name="IIS-HttpRedirect" state="true" />
            <selection name="IIS-HttpTracing" state="true" />
            <selection name="IIS-LoggingLibraries" state="true" />
            <selection name="IIS-IIS6ManagementCompatibility" state="true" />
            <selection name="IIS-Metabase" state="true" />
            <selection name="MSMQ-Container" state="true" />
            <selection name="MSMQ-Server" state="true" />
            <selection name="NetFx3" state="true" />
            <selection name="WAS-WindowsActivationService" state="true" />
            <selection name="WAS-ConfigurationAPI" state="true" />
            <selection name="WAS-NetFxEnvironment" state="true" />
            <selection name="WAS-ProcessModel" state="true" />

I can do it from a command line and am thinking about adding it to my scripts file but sysprep should do it for me.

FYI you can run this command to preform a default installation of IIS from the command line.

START /WAIT DISM /Online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-ASPNET /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-DefaultDocument /FeatureName:IIS-DirectoryBrowsing /FeatureName:IIS-HealthAndDiagnostics /FeatureName:IIS-HttpCompressionStatic /FeatureName:IIS-HttpErrors /FeatureName:IIS-HttpLogging /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-ManagementConsole /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-Performance /FeatureName:IIS-RequestFiltering /FeatureName:IIS-RequestMonitor /FeatureName:IIS-Security /FeatureName:IIS-StaticContent

Question by:TraJohnson
    LVL 3

    Accepted Solution

    The command I posted originally wasn't my working one, here you all go.  I added a line to my setupcomplete.cmd to call a .bat with this command in it and IIS installs fine at the first boot after deployment.

    START /WAIT DISM /Online /Enable-Feature /FeatureName:IIS-WebServerRole /FeatureName:IIS-WebServer /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-HttpErrors /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-Security /FeatureName:IIS-RequestFiltering /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-HealthAndDiagnostics /FeatureName:IIS-HttpLogging /FeatureName:IIS-RequestMonitor /FeatureName:IIS-Performance /FeatureName:IIS-WebServerManagementTools /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-StaticContent /FeatureName:IIS-DefaultDocument /FeatureName:IIS-DirectoryBrowsing /FeatureName:IIS-ASPNET /FeatureName:IIS-HttpCompressionStatic /FeatureName:IIS-ManagementConsole

    LVL 3

    Author Closing Comment

    Figured it out myself.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now