We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

View Complete Thread
  • Installing web server with pkgmgr and powershell

    Apr 16, 2008 01:53 PM|Kanien|LINK

    Hello,

     I have a 64bit wk8 server and I'm attempting to install the web server role and configure it through powershell as described in an article on iis.net.  My goal is to automate the configuration of my IIS7 web servers so that I do not have to configure them everytime I set a new one up.

     Here is my current problem:

     If I run get-process on the pkgmgr after attempting to make the call to pkgmgr it does not exist.  It is as if the pkgmgr is not starting.  Any suggestions?  I need to script it to install the web server role and features automatically.

    The PS code calls like this:

     #Get the path that this script is running in
    $scriptRoot = Split-Path (Resolve-Path $myInvocation.MyCommand.Path)

    #Call PKGMGR
    & $env:windir\system32\pkgmgr.exe ("/n:" + $scriptRoot + "\unattend.xml")

     The unattend.xml file looks like this:

     <?xml version="1.0" ?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend"
        xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
    <servicing>
       <!-- Install a selectable update in a package that is in the Windows Foundation namespace -->
       <package action="configure">
          <assemblyIdentity
             name="Microsoft-Windows-Foundation-Package"
             version="6.0.5308.6"
             language="neutral"
             processorArchitecture="x86"
             publicKeyToken="31bf3856ad364e35"
             versionScope="nonSxS"
          />
        <selection name="IIS-WebServerRole" state="true"/>
        <selection name="IIS-WebServer" state="true"/>
        <selection name="IIS-CommonHttpFeatures" state="true"/>
        <selection name="IIS-StaticContent" state="true"/>
        <selection name="IIS-DefaultDocument" state="true"/>
        <selection name="IIS-DirectoryBrowsing" state="true"/>
        <selection name="IIS-HttpErrors" state="true"/>
        <selection name="IIS-HttpRedirect" state="true"/>
        <selection name="IIS-ApplicationDevelopment" state="true"/>
        <selection name="IIS-ASPNET" state="true"/>
        <selection name="IIS-NetFxExtensibility" state="true"/>
        <selection name="IIS-ASP" state="true"/>
        <selection name="IIS-CGI" state="true"/>
        <selection name="IIS-ISAPIExtensions" state="true"/>
        <selection name="IIS-ISAPIFilter" state="true"/>
        <selection name="IIS-ServerSideIncludes" state="true"/>
        <selection name="IIS-HealthAndDiagnostics" state="true"/>
        <selection name="IIS-HttpLogging" state="true"/>
        <selection name="IIS-LoggingLibraries" state="true"/>
        <selection name="IIS-RequestMonitor" state="true"/>
        <selection name="IIS-HttpTracing" state="true"/>
        <selection name="IIS-CustomLogging" state="true"/>
        <selection name="IIS-ODBCLogging" state="true"/>
        <selection name="IIS-Security" state="true"/>
        <selection name="IIS-BasicAuthentication" state="true"/>
        <selection name="IIS-WindowsAuthentication" state="true"/>
        <selection name="IIS-DigestAuthentication" state="true"/>
        <selection name="IIS-ClientCertificateMappingAuthentication" state="true"/>
        <selection name="IIS-IISCertificateMappingAuthentication" state="true"/>
        <selection name="IIS-URLAuthorization" state="true"/>
        <selection name="IIS-RequestFiltering" state="true"/>
        <selection name="IIS-IPSecurity" state="true"/>
        <selection name="IIS-Performance" state="true"/>
        <selection name="IIS-HttpCompressionStatic" state="true"/>
        <selection name="IIS-HttpCompressionDynamic" state="true"/>
        <selection name="IIS-WebServerManagementTools" state="true"/>
        <selection name="IIS-ManagementConsole" state="true"/>
        <selection name="IIS-ManagementScriptingTools" state="true"/>
        <selection name="IIS-ManagementService" state="true"/>
        <selection name="IIS-IIS6ManagementCompatibility" state="true"/>
        <selection name="IIS-Metabase" state="true"/>
        <selection name="IIS-WMICompatibility" state="true"/>
        <selection name="IIS-LegacyScripts" state="true"/>
        <selection name="IIS-LegacySnapIn" state="true"/>
        <selection name="IIS-FTPPublishingService" state="true"/>
        <selection name="IIS-FTPServer" state="true"/>
        <selection name="IIS-FTPManagement" state="true"/>
        <selection name="WAS-WindowsActivationService" state="true"/>
        <selection name="WAS-ProcessModel" state="true"/>
        <selection name="WAS-NetFxEnvironment" state="true"/>
        <selection name="WAS-ConfigurationAPI" state="true"/>
      </package>
    </servicing>
    </unattend>