# Install IIS 10 and Register ASP.NET 4.7 with a Powershell Script

- 17 Nov 2017

- Dan Lister

* * *

Here is a nifty little script or two to help install IIS version 10 to a freshly setup machine. The below scripts will not only install IIS and ASP.NET but it will register ASP.NET with IIS so that you can run and host your applications.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
[Learn more about bidirectional Unicode characters](https://github.co/hiddenchars)

[Show hidden characters](/content/blog/install-iis-10-and-register-aspnet-47-with-a-powershell-script/index.html)

|     |     |
| --- | --- |
|  | #Requires -RunAsAdministrator |
|  |  |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-WebServerRole |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-WebServer |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-CommonHttpFeatures |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-HttpErrors |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-HttpRedirect |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ApplicationDevelopment |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-NetFxExtensibility |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-NetFxExtensibility45 |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-HealthAndDiagnostics |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-HttpLogging |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-LoggingLibraries |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-RequestMonitor |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-HttpTracing |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-Security |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-URLAuthorization |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-RequestFiltering |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-IPSecurity |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-Performance |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-HttpCompressionDynamic |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-WebServerManagementTools |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ManagementScriptingTools |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-IIS6ManagementCompatibility |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-Metabase |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-HostableWebCore |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-CertProvider |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-WindowsAuthentication |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-DigestAuthentication |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ClientCertificateMappingAuthentication |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-IISCertificateMappingAuthentication |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ODBCLogging |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-StaticContent |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-DefaultDocument |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-DirectoryBrowsing |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-WebDAV |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-WebSockets |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ApplicationInit |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ASPNET |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ASPNET45 |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ASP |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-CGI |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ISAPIExtensions |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ISAPIFilter |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ServerSideIncludes |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-CustomLogging |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-BasicAuthentication |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-HttpCompressionStatic |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ManagementConsole |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-ManagementService |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-WMICompatibility |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-LegacyScripts |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-LegacySnapIn |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-FTPServer |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-FTPSvc |
|  | Enable-WindowsOptionalFeature-Online -FeatureName IIS-FTPExtensibility |

[view raw](https://gist.github.com/danlister/c2ee364a99ab52a660ab5aed30159b13/raw/169383e7bc75c3811637763e08afc34dc1851687/install-iis.ps1) [install-iis.ps1](https://gist.github.com/danlister/c2ee364a99ab52a660ab5aed30159b13#file-install-iis-ps1)
hosted with ❤ by [GitHub](https://github.com/)

[Show hidden characters](/content/blog/install-iis-10-and-register-aspnet-47-with-a-powershell-script/index.html)

|     |     |
| --- | --- |
|  | #Requires -RunAsAdministrator |
|  |  |
|  | dism /online /enable-feature/all /featurename:IIS-ASPNET45 |

[view raw](https://gist.github.com/danlister/bb41173e8be8f6548c02cfea4bb009a0/raw/cfffae974f43053661ecea7298916c8c3620d801/register-aspnet.ps1) [register-aspnet.ps1](https://gist.github.com/danlister/bb41173e8be8f6548c02cfea4bb009a0#file-register-aspnet-ps1)
hosted with ❤ by [GitHub](https://github.com/)

* * *

Disqus Comments

We were unable to load Disqus. If you are a moderator please see our [troubleshooting guide](https://docs.disqus.com/help/83/).

G

Join the discussion…

Comment

###### Log in with

###### or sign up with Disqus  or pick a name

### Disqus is a discussion network

- Don't be a jerk or do anything illegal. Everything is easier that way.

[Read full terms and conditions](https://docs.disqus.com/kb/terms-and-policies/)

This comment platform is hosted by Disqus, Inc. I authorize Disqus and its affiliates to:

- Use, sell, and share my information to enable me to use its comment services and for marketing purposes, including cross-context behavioral advertising, as described in our [Terms of Service](https://help.disqus.com/customer/portal/articles/466260-terms-of-service) and [Privacy Policy](https://disqus.com/privacy-policy), including supplementing that information with other data about me, such as my browsing and location data.
- Contact me or enable others to contact me by email with offers for goods or services
- Process any sensitive personal information that I submit in a comment. See our [Privacy Policy](https://disqus.com/privacy-policy) for more information

Acknowledge I am 18 or older

I'd rather post as a guest

- [4](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default# "Favorite this discussion")

- ## Discussion Favorited!

Favoriting means this is a discussion worth sharing. It gets shared to your followers' Disqus feeds, and gives the creator kudos!

[Find More Discussions](https://disqus.com/home/?utm_source=disqus_embed&utm_content=recommend_btn)

[Share](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default#)

- Tweet this discussion
  - Share this discussion on Facebook
  - Share this discussion via email
  - Copy link to discussion

- [Best](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default#)
  - [Newest](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default#)
  - [Oldest](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default#)

- - [−](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default# "Collapse")
  - [+](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default# "Expand")
  - [Flag as inappropriate](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default# "Flag as inappropriate")

will it be available in the iis app polls

see more

[Show more replies](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default#)

[Load more comments](https://disqus.com/embed/comments/?base=default&f=agebase&t_u=https%3A%2F%2Fagebase.co.uk%2Fblog%2Finstall-iis-10-and-register-aspnet-47-with-a-powershell-script%2F&t_d=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&t_t=Install%20IIS%2010%20and%20Register%20ASP.NET%204.7%20with%20a%20Powershell%20Script&s_o=default#)

live.rezync.com

# live.rezync.com is blocked

This page has been blocked by an extension

- Try disabling your extensions.

ERR\_BLOCKED\_BY\_CLIENT

Reload

This page has been blocked by an extension

pippio.com

# pippio.com is blocked

This page has been blocked by an extension

- Try disabling your extensions.

ERR\_BLOCKED\_BY\_CLIENT

Reload

This page has been blocked by an extension
