Hello - Just started working with DSC - ran into a snag and haven’t been able to find a solution searching the Interweb - would greatly appreciate some help or being pointed in the right direction.
I have 2 virtual Windows 2012 R2 servers both running PS version 4.0 running in a lab environment. I am attempting to set up the DSC Pull Server Proof-of-Concept following the guide at:
On the end node - i am getting a Event 4104, Desired State Configuration error when trying to pull from the pull server.
Job{…}:
This event indicates that failure happens when LCM is trying to get the configuration from pull server using download manager WebDownloadManager. ErrorDetail is The Attempt to get the action from server http://server1:8080///PullSvc/PSDSCPullServer.svc/Action(ConfigurationId=‘0335b1aa-3956-496d-9e1d-41ceda386b4f’)/GetAction failed because a vaild configuration 0335b1aa-3956-496d-9e1d-41ceda386b4f cannot be found.
The script i used to create the pull server is as follows:
configuration Sample_xDscWebService
{
param
(
[string]$NodeName = ‘localhost’,
[ValidateNotNullOrEmpty()]
[string] $certificateThumbPrint = "AllowUnencryptedTraffic"
)
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Node $NodeName
{
WindowsFeature DSCServiceFeature
{
Ensure = "Present"
Name = "DSC-Service"
}
WindowsFeature WinAuth
{
Ensure = "Present"
Name = "web-Windows-Auth"
}
xDscWebService PSDSCPullServer
{
Ensure = "Present"
EndpointName = "PullSvc"
Port = 8080
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer"
CertificateThumbPrint = $certificateThumbPrint
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
State = "Started"
DependsOn = "[WindowsFeature]DSCServiceFeature"
}
xDscWebService PSDSCComplianceServer
{
Ensure = "Present"
EndpointName = "DscConformance"
Port = 9090
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer"
CertificateThumbPrint = "AllowUnencryptedTraffic"
State = "Started"
IsComplianceServer = $true
DependsOn = @("[WindowsFeature]DSCServiceFeature","[WindowsFeature]WinAuth","[xDSCWebService]PSDSCPullServer")
}
}
}
Sample_xDscWebService -ComputerName “Server1”
Start-DscConfiguration -Wait -Verbose .\Sample_xDscWebService
The script ran successfully and created the “PullSvc” & “DscConformance” sites in IIS.
I then ran the following script to configure the end-node:
Configuration TestConfig {
Param(
[Parameter(Mandatory=$True)]
[String[]]$NodeGUID
)
Node $NodeGUID {
File ScriptPresence {
Ensure = "Present"
Type = "Directory"
Recurse = $True
SourcePath = "\\Server1\Test"
DestinationPath = "C:\Temp\DSCTest"
}
}
}
$Computers = @(“Server2”)
write-host “Generating GUIDs and creating MOF files…”
foreach ($Node in $Computers)
{
$NewGUID = [guid]::NewGuid()
$NewLine = “{0},{1}” -f $Node,$NewGUID
TestConfig -NodeGUID $NewGUID
$NewLine | add-content -path “$env:SystemDrive\Program Files\WindowsPowershell\DscService\Configuration\dscnodes.csv”
}
write-host “Creating checksums…”
New-DSCCheckSum -ConfigurationPath .\TestConfig -OutPath .\TestConfig -Verbose -Force
write-host “Copying configurations to pull service configuration store…”
$SourceFiles = (Get-Location -PSProvider FileSystem).Path + “\TestConfig*.mof*”
$TargetFiles = “$env:SystemDrive\Program Files\WindowsPowershell\DscService\Configuration”
Move-Item $SourceFiles $TargetFiles -Force
Remove-Item ((Get-Location -PSProvider FileSystem).Path + "\TestConfig")
The script ran successfully and created the “dscnodes.csv” - validated the correct entry inside. Also created “0335b1aa-3956-496d-9e1d-41ceda386b4f.mof” & “0335b1aa-3956-496d-9e1d-41ceda386b4f.mof.checksum”
On the end-node “Server2” - I ran the following script:
Configuration SimpleMetaConfigurationForPull
{
Param(
[Parameter(Mandatory=$True)]
[String]$NodeGUID
)
LocalConfigurationManager
{
ConfigurationID = $NodeGUID;
RefreshMode = "PULL";
DownloadManagerName = "WebDownloadManager";
RebootNodeIfNeeded = $true;
RefreshFrequencyMins = 15;
ConfigurationModeFrequencyMins = 30;
ConfigurationMode = "ApplyAndAutoCorrect";
DownloadManagerCustomData = @{ServerUrl = "http://Server1.mycompany.com:8080/PullSvc/PSDSCPullServer.svc"; AllowUnsecureConnection = “TRUE”}
}
}
$data = import-csv “\server1.mycompany.com\c$\Program Files\WindowsPowershell\DscService\Configuration\dscnodes.csv” -header(“NodeName”,“NodeGUID”)
SimpleMetaConfigurationForPull -NodeGUID ($data | where-object {$_.“NodeName” -eq $env:COMPUTERNAME}).NodeGUID -Output “.”
$FilePath = (Get-Location -PSProvider FileSystem).Path + “\SimpleMetaConfigurationForPull”
Set-DscLocalConfigurationManager -ComputerName “localhost” -Path $FilePath -Verbose
The script ran successfully. On the end-node “Server2” - the Get-DscLocalConfigurationManager command returns the correct ConfigurationID, Mode, etc.
When i run a Get-DscConfiguration - it returns “Current configuration does not exist.”
Am i missing something or - is this a permissions issue? Any help would be appreciated.
Thanks …