Skip to main content

Automating IIS Feature Installation with Powershell – Rick Strahl’s Web Log

By February 27, 2023March 1st, 2023No Comments

Looking for:

How to install IIS on Windows 10 using Powershell – H2S Media.IIS 6 Management Console enable with command line of dism – Stack Overflow

Click here to Download

When I try to turn “IIS Metabase and IIS 6 configuration compatibility” back on in Windows Features, it results in the message “Some features. I am trying to installl IIS 6 Metabase Compatibility feature on windows server R2, it repors the request to add or remove features on.

Installing IIS and management features using PowerShell | Amit Gupta’s Blog

There are obviously a lot more options you can set on these components, but it’s easy to find out about those. JoeM March 01, Not the answer you’re looking for?


Windows 10 install iis 6 metabase compatibility powershell free


Here’s an oldie but goodie, that keeps coming up for me rather frequently. As a result I deal with a lot of support issues around IIS and people who install IIS run an application for years, have their servers eventually break down and then have to reinstall years after their last install. And a lot of times the people who set up the system are long gone. The chief complaints I hear frequently is that it’s a pain to get IIS to install initially with all the right components.

I tend to agree – especially on Server versions installing IIS through the insanely user hostile Server Manager interface is a pain. But there’s an easier, quicker and repeatable way if you’re willing to dive into the command line or create and run a small Powershell script.

Apparently many people are unaware that in recent versions of Windows – using Powershell – you can automate the IIS Features installation using a few simple Powershell Commandlet calls. It’s as easy as creating a small PowerShell script file and letting her rip.

This command works both on desktop and server versions server versions also have Enable-WindowsFeature which has the same effect and makes it pretty easy to automate an IIS install by whittling away a few commands in a Powershell script file.

You can tweak and fiddle with the features you actually need for IIS, but the above is pretty standard for my base installs. You can install those from the Web Platform installer, or – which is easier in my case – from Chocolatey:.

Enable-WindowsOptionalFeature is great, as long as you know what’s available. Luckily it’s easy to figure out what’s available and what’s installed and what’s not. You can configure IIS via more powershell helpers by using the WebAdministration powershell module most like already installed :.

There are obviously a lot more options you can set on these components, but it’s easy to find out about those. I also recommend that while you’re discovering features, use the PowerShell ISE shell run from the Start menu using Run as Administrator to discover what’s available:. The Intellisense in the editor and the command window gives you live property values on commands and even live objects as shown in the Figure 1 which makes it relatively easy to figure out settings.

For the rest the various cmd-lets and admin objects are well documented and searchable. None of this is new of course, but it’s always good to be reminded that you can automate installation and configuration of IIS relatively easily. This is especially true since I just this week I heard from several people how much of a pain IIS can be to install and get up and running. It doesn’t have to be this way Very useful Rick!

For some reason IIS does not come as standard with the very useful feature to import an application as a ZIP file and Microsoft make it super hard to find the link to download that add-on. It forces you to first install the “Web Platform Platform Installer Platform” or something, and then find an obscure link. I’m guessing that can’t be done from PowerShell, but it sure would be useful. While it is possible to use PowerShell or any other scripting toy, or msiexec to get the bits installed, the installer’s user interface is the only documented way to fully customize the setup.

This looks good, Rick. I combined it with non-DSC PowerShell that manually checks to see if things are already configured, and now have a re-runnable script that I can run on my “pet” servers. Maybe this will become less important once I start treating my servers more like cattle, and stand up new ones every deployment. This is for Windows 7 Enterprise 64 bit. I second the need for a powershell script for IIS 6. I’m currently writing an automated installation for BizTalk and part of the prerequisites are:.

Jan – use Get-WindowsOptionalFeature and look through the list – it’s in there. See how I query for features not installed int the post. Super article Rick, Thanks! You know you’ll need ASP. NET which means you’ll need most things I mentioned above but it’s still on a case by case basis to pick out what you need. One commenter at least provided a link to WebDeploy. Those are essential refernces, if you expect readers easily be able to easily follow this.

I’ve used this quite a bit since you first posted it. Another feature? Where can I get it? And, same question for “chocolatey” – I will Google for these vs. Josh – you are right in that I make some basic assumptions here. This is a developer Weblog and I post developer stuff and if you’re not a developer dealing with this stuff this blog will be a slog. That said – if you can’t figure out how to search for Web Platform Installer or Chocolatey then you probably are not in the intended audience.

No offense, but true. That doesn’t mean you can’t use any of this, you just need to do a little extra work to add to your repertoire of tools.

If you are administering a Web Server those two distribution tools will be critical and it’ll be a worthwhile. Happy searching I love powershell for installing almost everything now. This one works flawlessly for a standard Laserfiche Web deployment.

Thanks so much! I am not sure what happened to my previous post. But, I am trying to have this installed on Windows 10 desktop for developers. Default it is going to be installed on C drive. Now, with the C drive being a VDISK and if it is locked down that users cannot make changes, will it affect in anyway if they have develop the websites and put it in InetPub folder in D drive?

Next, I also got a script from this Microsoft link which be used to automate the relocating of the Inetpub contents, and will leave the existing directory structure untouched. Will this affect your installation in anyway? I am going to build a new Windows 10 box with C drive and D drive and I am going to run your script to install IIS and also I am going to run this script to see how it goes. At any rate, I didn’t change much beyond the main block, and when testing, it does appear to have an issue being able to pull from a management tool or parent feature, so I may get around to fleshing it out a bit more I just liked what I saw, it’s a lot like the version I put together Still, I learn things when I see how other people approach similar tasks.

So, kudos for making this Now I have the requirement to check if IIS-WebSockets are installed – if so, enable the installation of a specific website that makes use of it. Notes on number 1: until now I have found a couple of Registry keys on the web that either simply do not exist on Windows 10, or do not seem to indicate whether the component is enabled or not, so it’s not very useful.

Notes on number 2: The dll may exists on the target machine or not, but that still does not give me any clue whether it is enabled or not. So also not very useful. Notes on number 3: This may well give me the information I need, so it sounds like the perfect option, but then the installer gets dependent on whether the PowerShell utility is installed or not.

Question is: Can you or anybody give me any advice to what my best option is in this particular case? Thanks a lot in advance for any help you can offer!

Regards, Pieter. I’m curious if there’s a way to do the opposite and take an existing IIS configuration and list all of the options that are enabled? Is it simply a backup and restore procedure? Basically I need to migrate an existing IIS application from one cloud provider to another and I think this is what I’m after. Sponsored by:. Share on:. On this page:. Is this content useful to you?

Consider making a small donation to show your support. Posted in IIS Windows. Rich May 26, SomeUser May 27, Jon May 30, Jan August 20, Chad October 18, Rick Strahl October 18, John March 18, Mikey June 07, Alberto June 14, Anupam February 16, Rick Strahl February 17, JoeM March 01, Rick Strahl March 02, Jayson April 16, Sam July 11, You have helped me tremendously, with your concise explanations and cogent, clear tips!

You have saved me so much time. Thanks, Sam.


ITOM Practitioner Portal – Your Answer

Jan 31,  · I would like to know how to enable that IIS 6 Management Console with dism command line. I tried some command, but it was not working. IIS-LegacySnapIn That will install IIS 6 Management Console with dism. Regards. Share. Improve this answer. How to run MVC app in IIS 10 on Windows 3. Dec 08,  · In the Select Role Services pane, scroll down to IIS 6 Management Compatibility. Click to select the IIS 6 Metabase Compatibility, IIS 6 WMI Compatibility, and IIS 6 Management Console check boxes. In the Select Role Services pane, click Next. In the Confirm Installations Selections pane, click Install. Click Close to exit the Add Role Services wizard. May 25,  · IIS often gets a bad wrap for being diffcult to install and configure. However, using some of the built-in tooling for administration using PowerShell it’s actually quite easy to configure IIS and even set up a new site and application pool with a few short scripts that are much quicker, and more repeatable than using the various Windows UI features. Here’s how.