How to configure an SCCM Server with DSC

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of crashrebootrepeat crashrebootrepeat 2 years, 3 months ago.

  • Author
    Posts
  • #24119
    Profile photo of crashrebootrepeat
    crashrebootrepeat
    Participant

    Hi,

    I have a question about configuring an SCCM server with DSC. I currently have a configuration file that includes all of the requirements

    I execute that with the following type of script

    [b]Install-WindowsFeature -ConfigurationFilePath d:\ConfigurationFiles\ADCSConfigFile.xml[/b

    If I wanted to do this with DSC instead (I am about to do a new deployment with quite a few servers) is there a way for me to include that configuration file in the DSC

    IF NOT

    how do I include all of the sub features needed? For example IIS has a bunch of SUB features under it. I don't need it all because that could make it not work. I just need to select the sub features I need

  • #24123
    Profile photo of Daniel Krebs
    Daniel Krebs
    Moderator

    Hi,

    Not sure where you are in your DSC learning journey. You will need to declare your Configuration from scratch. You can look at the XML to find out which feature names are being used and create the Configuration script. I can highly recommend to watch the Microsoft Virtual Academy course for PowerShell DSC with Jeffrey Snover and Jason Helmick.

    http://www.microsoftvirtualacademy.com/training-courses/getting-started-with-powershell-desired-state-configuration-dsc-

    Example configuration:

    Configuration WebServer {
    
        WindowsFeature 'Web-Server' {
            Name = 'Web-Server'
            Ensure = 'Present'
        }
    
        WindowsFeature 'Web-Windows-Auth' {
            Name = 'Web-Windows-Auth'
            Ensure = 'Present'
            DependsOn = '[WindowsFeature]Web-Server'
        }
    
        WindowsFeature 'Web-DAV-Publishing' {
            Name = 'Web-DAV-Publishing'
            Ensure = 'Present'
            DependsOn = '[WindowsFeature]Web-Server'
        }
    }
    

    Regards
    Daniel

  • #24159
    Profile photo of crashrebootrepeat
    crashrebootrepeat
    Participant

    Hi Daniel – Thanks for your response and example it really helped me out. I also figured out that I can go a

    get-windowsfeature | ogv

    To figure out the names of the sub features I need.

You must be logged in to reply to this topic.