Modified cWebsite DSC Resource: Added net.pipe binding functionality + fixes

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of James Killgore James Killgore 1 year, 1 month ago.

  • Author
  • #29115
    Profile photo of James Killgore
    James Killgore

    Hello All,

    I have made some changes to the cWebsite resource. Specifically I needed to be able to create websites with the net.pipe binding. Here is a link to the zip with the .psm1 and .schema.mof files in my OneDrive:!4987&authkey=!AEcoU0o6NkX-wDw&ithint=file%2czip

    Been emailing with Jason back and forth a bit and he recommended I share the updated resource here for feedback. I am confident I did not make the most efficient changes as I am most certainly no PS or DSC expert, so any thoughts you have on improvements or changes would be awesome.

    Anyway, here is a brief change log (I have also commented all the added/modified code):

    Added net.pipe as a valid binding entry.

    Line 70 and 71 – Added information on New-CimInstance error encountered (

    Line 702 – Updated command to get website bindings including net.pipe bindings.

    Line 722 – Added counter for binding comparison loop. This helped fix a false negative when running test-dscconfiguration.

    Line 725 – Incorporated counter in command to prevent multiple values being stored in variable.

    Line 837 – Added if statement to prevent port parameters being added for net.pipe bindings.

    Line 868 – Added if else statement to prevent binding creation command from running for net.pipe bindings as the command cannot successfully create net.pipe bindings. Else block with run the proper command to create net.pipe binding.

    Line 918 – Added if statement to prevent net.pipe bindings from being split into individual sections for comparison.

    Line 939 – Added if else statement to return appropriate properties for a net.pipe binding.

    A couple gotchas you may need to know are:

    1. net.pipe bindings in your configuration need to look like this:

    cWebSite default {
                Name = 'Default Web Site'
                PhysicalPath = '%SystemDrive%\inetpub\wwwroot'
                DependsOn = '[WindowsFeature]webserver','[Service]netPipeService'
                BindingInfo = @(
                        Protocol = 'net.pipe'
                        Protocol = 'HTTP'
                        Port     = 80
                        IPAddress = '*'
                Ensure = 'Present'

    2. In order for IIS to make sense of your website after adding a net.pipe binding, you will need to start the net.pipe service in Windows. Hence the DependsOn = '[Service]netPipeService' portion of the configuration.

    Let me know if there are any changes I should make or anything else I should do with this. Any feedback or testing would be great!


You must be logged in to reply to this topic.