Installing Windows Features Without Default Selections

Welcome Forums DSC (Desired State Configuration) Installing Windows Features Without Default Selections

This topic contains 1 reply, has 2 voices, and was last updated by

4 years ago.

  • Author
  • #22881

    Points: 22
    Rank: Member

    I'm working on a configuration for a 2008 R2 server that uses the WindowsFeature resource to install a set of roles and features on the server. One of the things I have notices is that there are certain features that install all the sub-features underneath them by default. For example, I want to Install Web-Windows-Auth and Web-Filtering. Those both fall under Web-Security. If I use the following config to try to install Web-Security, Web-Windows-Auth and Web-Filtering, it ends up installing all the features under Web-Security. For Example, If I use the following config:

        WindowsFeature Web-Security {
    	    Name = "Web-Security"
    	    Ensure = "Present"
            IncludeAllSubFeature = $false
        WindowsFeature Web-Windows-Auth {
    	    Name = "Web-Windows-Auth"
    	    Ensure = "Present"
            IncludeAllSubFeature = $false
        WindowsFeature Web-Filtering {
    	    Name = "Web-Filtering"
    	    Ensure = "Present"
            IncludeAllSubFeature = $false

    This doesn't just install Web-Security, Web-Windows-Auth and Web-Filtering. It installs all the features under Web-Security. I can get around this by taking Web-Security out of the config and just leaving the other two in there, but we want the config to document what is installed on these servers so that someone just needs to look at the config to know everything that is installed on the servers.

    Has anyone else run into this at all? I assume it has to do with the fact that when you manually go to add Web-Security to a server, it selects everything underneath it by default. I was just hoping there was a way to tell it not to use the defaults. I tried to set IncludeAllSubFeature to False but that didn't work.


  • #22960

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    That's a function of the underlying feature manager, unfortunately, and the current commands don't provide a workaround for that behavior. -InculdeAllSubFeature doesn't change the underlying default behavior. Under the hood, it's just doing whatever Install-WindowsFeature would natively do.

The topic ‘Installing Windows Features Without Default Selections’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort