Windows

在 Windows 2008 R2 上通過 pkgmgr 腳本安裝 IIS 7.5

  • September 7, 2010

嘗試在 Windows Server 2008 R2 上安裝 IIS 使用此技術網文章中描述的以下腳本時,我收到有關"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

有人知道這裡可能會發生什麼嗎?

以下似乎有效:

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-應用程序開發;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-Cus ODBCLogging;IIS -安全;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;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

通過組策略,上述內容似乎也可以作為啟動腳本正常工作。

引用自:https://serverfault.com/questions/178797