|
您可以使用本文档中的过程来安装 IIS 8.0 或 IIS 8.5。
- DISM.EXE /enable-feature /online /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-ASPNET /featureName:IIS-NetFxExtensibility
- /featureName:IIS-ASPNET45 /featureName:IIS-NetFxExtensibility45 /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-WebDAV /featureName:IIS-WebServerManagementTools /featureName:IIS-ManagementScriptingTools
- /featureName:IIS-ManagementService /featureName:IIS-IIS6ManagementCompatibility /featureName:IIS-Metabase
- /featureName:IIS-WMICompatibility /featureName:IIS-LegacyScripts /featureName:IIS-FTPServer /featureName:IIS-FTPSvc
- /featureName:IIS-FTPExtensibility /featureName:NetFx4Extended-ASPNET45 /featureName:IIS-ApplicationInit
- /featureName:IIS-WebSockets /featureName:IIS-CertProvider /featureName:IIS-ManagementConsole /featureName:IIS-LegacySnapIn
复制代码
如果您需要部署多个 Web 服务器并希望确保每个 Web 服务器都设置有相同的组件和服务,那么使用无人参与的脚本自动安装 IIS 非常有用。在 Windows Server 2012 R2 中,DISM 用于无人参与的脚本,允许您从命令提示符或脚本中安装或卸载可选功能。要使用 DISM,您必须确保您拥有计算机的管理用户权限。
使用 PowerShell 安装 IIS 8.5
- import-module servermanager
- 要仅安装特定功能,请在 PowerShell cmdlet 中列出它们,如下例所示:
- [code]import-module servermanager
- add-windowsfeature Web-Server, Web-WebServer, Web-Security,
- Web-Filtering
复制代码
add-windowsfeature web-server -includeallsubfeature[/code]
以下几点适用于运行 PowerShell cmdlet:
1.cmdlet 需要提升。您必须以管理员身份运行 Windows PowerShell 会话才能运行 cmdlet。
2.默认情况下,该 cmdlet 不安装角色、角色服务和功能的管理工具。为此,您必须将 IncludeManagementTools 参数添加到 cmdlet。
快速卸载IIS命令:
- start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel
复制代码
|
|