DSC-Node not pulling config

Welcome Forums DSC (Desired State Configuration) DSC-Node not pulling config

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

 
Participant
2 months, 4 weeks ago.

  • Author
    Posts
  • #161496

    Participant
    Topics: 2
    Replies: 1
    Points: 29
    Rank: Member

    my DSC node is not pulling the DSC config from my SMB DSC server. Get-DSCConfigurationStatus says the pull was successfull but Get-DSCConfiguration remains the same(old config).

    Im testing it with a HelloWorld config where a file is created on the C drive. When i delete the file Get-DSCConfiguration says "Enusre: absent" but when it pulls the new config, it should be "ensure: present". I have no errors or anything else. Idk why it isn't pulling correctly.

    My DSC LCM config:

    $secpasswd = ConvertTo-SecureString PASSWORD -AsPlainText -Force
    $mycreds = New-Object System.Management.Automation.PSCredential (“SERVUSER”, $secpasswd)
    
    [DSCLocalConfigurationManager()]
    configuration PullClientConfig
    {
        param(
        [PSCredential]$DomainCredential
    )
    
        Node 'localhost'
        {
            Settings
            {
                RefreshMode = 'Pull'
                RefreshFrequencyMins = 30
                RebootNodeIfNeeded = $false
                ConfigurationID = '2fda9b6d-e1be-46a9-8b92-e25cb17026cd'
    
            }
    
             ConfigurationRepositoryShare SmbConfigShare
            {
                SourcePath = '\\SERVER\SHARE'
                Credential = $mycreds
            }
    
            ResourceRepositoryShare SmbResourceShare
            {
                SourcePath = '\\SERVER\SHARE'
                Credential = $mycreds
    
            }
        }
    }
    $cd = @{
        AllNodes = @(
            @{
                NodeName = 'localhost'
                PSDscAllowPlainTextPassword = $true
            }
        )
    }

    My HelloWord config:

    Configuration HelloWorld {
    
        param (
            [string[]]$ComputerName = "localhost" # i have changed this parameter to the servername
        )
    
        # Import the module that contains the File resource.
        Import-DscResource -ModuleName PsDesiredStateConfiguration
    
        # The Node statement specifies which targets to compile MOF files for, when this configuration is executed.
        Node $ComputerName {
    
            # The File resource can ensure the state of files, or copy them from a source to a destination with persistent updates.
            File HelloWorld {
                DestinationPath = "C:\HelloWorld.txt"
                Ensure = "Present"
                Contents   = "Hello World from DSC!"
            }
        }
    }

    Update-DScConfiguration says that there is no newer config, so it wont pull. Do i understand DSC Right it has a config and the node trys to suit this config. So it basicaly has to pull a config again and apply it, instead it keeps the old config, refuses to pull. But the old config is wrong.... i dont get it...

  • #162239

    Senior Moderator
    Topics: 8
    Replies: 1041
    Points: 3,440
    Helping Hand
    Rank: Community Hero

    What is the ConfigurationMode. Can you post the Get-DscLocalConfigurationManager output here.

    • #162555

      Participant
      Topics: 2
      Replies: 1
      Points: 29
      Rank: Member

      ActionAfterReboot : ContinueConfiguration
      AgentId : 99F3DD1B-806C-11E9-80F3-005056A42D99
      AllowModuleOverWrite : False
      CertificateID :
      ConfigurationDownloadManagers : {[ConfigurationRepositoryShare]SmbConfigShare}
      ConfigurationID : 2fda9b6d-e1be-46a9-8b92-e25cb17026cd
      ConfigurationMode : ApplyAndMonitor
      ConfigurationModeFrequencyMins : 15
      Credential :
      DebugMode : {NONE}
      DownloadManagerCustomData :
      DownloadManagerName :
      LCMCompatibleVersions : {1.0, 2.0}
      LCMState : Idle
      LCMStateDetail :
      LCMVersion : 2.0
      StatusRetentionTimeInDays : 10
      SignatureValidationPolicy : NONE
      SignatureValidations : {}
      MaximumDownloadSizeMB : 500
      PartialConfigurations :
      RebootNodeIfNeeded : False
      RefreshFrequencyMins : 30
      RefreshMode : Pull
      ReportManagers : {}
      ResourceModuleManagers : {[ResourceRepositoryShare]SmbResourceShare}
      PSComputerName :

       

      I have set it now to ApplyAndAutoCorrect. Okay it does work now thank you 🙂

You must be logged in to reply to this topic.