查看: 489|回复: 0

[文章教程] 使用DISM控制台和PowerShell cmdlet安装IIS 8.5

[复制链接]
xuanxiao 发表于 2022-7-5 10:22:23 | 显示全部楼层 |阅读模式
您可以使用本文档中的过程来安装 IIS 8.0 或 IIS 8.5。

  1. DISM.EXE /enable-feature /online /featureName:IIS-WebServerRole /featureName:IIS-WebServer
  2. /featureName:IIS-CommonHttpFeatures /featureName:IIS-StaticContent /featureName:IIS-DefaultDocument
  3. /featureName:IIS-DirectoryBrowsing /featureName:IIS-HttpErrors /featureName:IIS-HttpRedirect
  4. /featureName:IIS-ApplicationDevelopment /featureName:IIS-ASPNET /featureName:IIS-NetFxExtensibility
  5. /featureName:IIS-ASPNET45 /featureName:IIS-NetFxExtensibility45 /featureName:IIS-ASP /featureName:IIS-CGI
  6. /featureName:IIS-ISAPIExtensions /featureName:IIS-ISAPIFilter /featureName:IIS-ServerSideIncludes
  7. /featureName:IIS-HealthAndDiagnostics /featureName:IIS-HttpLogging /featureName:IIS-LoggingLibraries
  8. /featureName:IIS-RequestMonitor /featureName:IIS-HttpTracing /featureName:IIS-CustomLogging
  9. /featureName:IIS-ODBCLogging /featureName:IIS-Security /featureName:IIS-BasicAuthentication
  10. /featureName:IIS-WindowsAuthentication /featureName:IIS-DigestAuthentication
  11. /featureName:IIS-ClientCertificateMappingAuthentication /featureName:IIS-IISCertificateMappingAuthentication
  12. /featureName:IIS-URLAuthorization /featureName:IIS-RequestFiltering /featureName:IIS-IPSecurity
  13. /featureName:IIS-Performance /featureName:IIS-HttpCompressionStatic /featureName:IIS-HttpCompressionDynamic
  14. /featureName:IIS-WebDAV /featureName:IIS-WebServerManagementTools /featureName:IIS-ManagementScriptingTools
  15. /featureName:IIS-ManagementService /featureName:IIS-IIS6ManagementCompatibility /featureName:IIS-Metabase
  16. /featureName:IIS-WMICompatibility /featureName:IIS-LegacyScripts /featureName:IIS-FTPServer /featureName:IIS-FTPSvc
  17. /featureName:IIS-FTPExtensibility /featureName:NetFx4Extended-ASPNET45 /featureName:IIS-ApplicationInit
  18. /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
  1. import-module servermanager

  2. 要仅安装特定功能,请在 PowerShell cmdlet 中列出它们,如下例所示:

  3. [code]import-module servermanager
  4. add-windowsfeature Web-Server, Web-WebServer, Web-Security,
  5. Web-Filtering
复制代码

add-windowsfeature web-server -includeallsubfeature[/code]

以下几点适用于运行 PowerShell cmdlet:

1.cmdlet 需要提升。您必须以管理员身份运行 Windows PowerShell 会话才能运行 cmdlet。
2.默认情况下,该 cmdlet 不安装角色、角色服务和功能的管理工具。为此,您必须将 IncludeManagementTools 参数添加到 cmdlet。


快速卸载IIS命令:
  1. start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel
复制代码


您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号