DSC Setup - Issue

I’m trying to deploy a new DSC pull server to replace our current one that is in production. When trying to deploy a basic script like this.

# Step 1 Install xPSDesiredStateConfiguration
Install-Module -Name xPSDesiredStateConfiguration

# Step 2
# Create the Pull Server. 

Configuration CreatePullServer {
    param (
        [string[]]$ComputerName = 'localhost'
    )

    Import-DSCResource -ModuleName xPSDesiredStateConfiguration -ModuleVersion 9.2.1
    Import-DSCResource –ModuleName PSDesiredStateConfiguration

    Node $ComputerName {
        WindowsFeature DSCServiceFeature {
            Ensure = "Present"
            Name   = "DSC-Service"
        }

        xDscWebService PSDSCPullServer {
            Ensure                   = "Present"
            UseSecurityBestPractices = 0
            EndpointName             = "PSDSCPullServer"
            Port                     = 8080
            PhysicalPath             = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer"
            CertificateThumbPrint    = "AllowUnencryptedTraffic"
            ModulePath               = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
            ConfigurationPath        = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
            State                    = "Started"
            DependsOn                = "[WindowsFeature]DSCServiceFeature"
        }

    }

}

#Creates the .mof file
CreatePullServer

# Apply the Pull Server configuration to the Pull Server
Start-DscConfiguration .\CreatePullServer -Wait -Verbose

I’m getting error messages.

PS D:\DSC\_setup> Start-DscConfiguration .\CreatePullServer -Wait -Verbose
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer ******-DSC02 with user sid ****-1167487308-122181.
VERBOSE: [SYT-PENM-DSC02]: LCM:  [ Start  Set      ]
VERBOSE: [SYT-PENM-DSC02]: LCM:  [ End    Set      ]
The only way DSC Partial Configurations can be used in Push mode is if the Publish-DscConfiguration Cmdlet is used. No other push cmdlet is supported. To avoid this error, either set a metaconfiguration without partial configurations, or use the Publish-DscConfiguration cmdlet to deploy your partial configuration.
    + CategoryInfo          : NotImplemented: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 7
    + PSComputerName        : localhost
 
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.908 seconds

PS D:\DSC\_setup> 

I’ve tried a few various setup scripts and I seem to run into the same issue every time. I know that I can push the configuration but I’m not really sure what that achieves as the server isn’t complete yet.

Looking online I can’t see many topic that’s that are less then five years old so any help would be appreciated. I’m not looking for Azure DSC at this time either.

1 Like

I don’t have any experience with DSC. However, it seems like the client “SYT-PENM-DSC02” needs to be configured to pull configurations from the new DSC Pull server. After reviewing MS docs I found the default RefreshMode for the node metaconfiguration is ‘Push’. The LCM needs to be modified to look at the new pull server and set refreshmode to pull:

So I’ve used DSC before and currently have it in production, but wasn’t something I set up directly.

In normal operations, you use an LCM script to register with a pull and tell it what partial configs to pull. For this scenario there isn’t a DSC server yet so it’s not quite that.

When building a DSC server from scratch you can build it using DSC so in this instance there isn’t yet a pull server. There’s plenty of short videos How To Configure A Desired State Configuration (DSC) Pull Server but just seems something might have changed in more recent versions.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.