在 Windows 2008 R2 上通过 pkgmgr 脚本安装 IIS 7.5

在 Windows 2008 R2 上通过 pkgmgr 脚本安装 IIS 7.5

尝试在 Windows Server 2008 R2 上安装 IIS 时使用以下脚本,如中所述这篇 Technet 文章我收到有关"encountered unknown option "featurename" with the value .... "所有功能的错误。

脚本:

CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;WAS-WindowsActivationService;WAS-ProcessModel;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;MicrosoftWindowsPowerShell

日志:

2010-09-07 14:20:04, Info                  DISM   DISM.EXE: Host machine information: OS Version=6.1.7600, Running architecture=amd64, Number of processors=8
2010-09-07 14:20:04, Info                  DISM   DISM.EXE: Executing command line: "C:\Windows\system32\dism.exe" /online /norestart /logpath:"C:\Users\administrator\Desktop\log.etw.txt" /enable-feature /ignorecheck /featurename:"IIS-WebServerRole" /featurename:"IIS-WebServer" /featurename:"IIS-CommonHttpFeatures" /featurename:"IIS-StaticContent" /featurename:"IIS-DefaultDocument" /featurename:"IIS-DirectoryBrowsing" /featurename:"IIS-HttpErrors" /featurename:"IIS-HttpRedirect" /featurename:"IIS-ApplicationDevelopment" /featurename:"IIS-ASP" /featurename:"IIS-CGI" /featurename:"IIS-ISAPIExtensions" /featurename:"IIS-ISAPIFilter" /featurename:"IIS-ServerSideIncludes" /featurename:"IIS-HealthAndDiagnostics" /featurename:"IIS-HttpLogging" /featurename:"IIS-LoggingLibraries" /featurename:"IIS-RequestMonitor" /featurename:"IIS-HttpTracing" /featurename:"IIS-CustomLogging" /featurename:"IIS-ODBCLogging" /featurename:"IIS-Security" /featurename:"IIS-BasicAuthentication" /featurename:"IIS-WindowsAuthentication" /featurename:"IIS-DigestAuthentication" /featurename:"IIS-ClientCertificateMappingAuthentication" /featurename:"IIS-IISCertificateMappingAuthentication" /featurename:"IIS-URLAuthorization" /featurename:"IIS-RequestFiltering" /featurename:"IIS-IPSecurity" /featurename:"IIS-Performance" /featurename:"IIS-HttpCompressionStatic" /featurename:"IIS-HttpCompressionDynamic" /featurename:"IIS-WebServerManagementTools" /featurename:"IIS-ManagementScriptingTools" /featurename:"IIS-IIS6ManagementCompatibility" /featurename:"IIS-Metabase" /featurename:"IIS-WMICompatibility" /featurename:"IIS-LegacyScripts" /featurename:"WAS-WindowsActivationService" /featurename:"WAS-ProcessModel" /featurename:"IIS-FTPServer" /featurename:"IIS-FTPSvc" /featurename:"IIS-FTPExtensibility" /featurename:"IIS-WebDAV" /featurename:"IIS-ASPNET" /featurename:"IIS-NetFxExtensibility" /featurename:"WAS-NetFxEnvironment" /featurename:"WAS-ConfigurationAPI" /featurename:"IIS-ManagementService" /featurename:"MicrosoftWindowsPowerShell"
......
2010-09-07 14:20:05, Info                  DISM   DISM Package Manager: PID=1576 Encountered the option "featurename" with value "IIS-WebServerRole" - CPackageManagerCLIHandler::Private_GetPackagesFromCommandLine

有人知道这里可能发生什么吗?

答案1

以下方法似乎有效:

CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS -DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;WAS-WindowsActivationService;WAS-ProcessModel;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;NetFx3

相同但在代码标记中:

CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;WAS-WindowsActivationService;WAS-ProcessModel;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;NetFx3

上述内容似乎也可以通过组策略作为启动脚本正常工作。

相关内容