I am having a problem with the update-dscconfiguration. I can register my node to the pullserver but it won’t get the configurationfile. I think this is caused by the same issue of update-dscconfiguration with the following error:
The attempt to ‘get an action’ for AgentId 153B0A2D-2A68-11E7-9662-000C2936433B from server URL https://d
sc-server///PsDscPullserver.svc/Nodes(AgentId=‘153B0A2D-2A68-11E7-9662-000C2936433B’)/GetDscAction
failed with server error ‘ResourceNotFound(404)’.
For further details see the server error message below or the DSC debug event log with ID 4339.
ServerErrorMessage:- ‘The assigned configuration ‘Webservice’ is not found in the pull server
configuration repository.’
I’m Working with a HTTPS pullserver with WMF5.
Pullserver script:
Configuration PullServer {
param
(
[string]$computerName = “localhost”,
[ValidateNotNullOrEmpty()]
[string]$certificateThumbPrint,
[ValidateNotNullOrEmpty()]
[string]$RegistrationKey
)
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Import-DSCResource -ModuleName PSDesiredStateConfiguration
# Load the Windows Server DSC Service feature
Node $computerName
{
WindowsFeature DSCServiceFeature
{
Ensure = 'Present'
Name = 'DSC-Service'
}
# Use the DSC Resource to simplify deployment of the web service
xDSCWebService PSDSCPullServer
{
Ensure = 'Present'
EndpointName = 'PSDSCPullServer'
Port = 443
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'
UseSecurityBestPractices = $false
}
File RegistrationKeyFile
{
Ensure = 'Present'
Type = 'File'
DestinationPath = "$env:ProgramFiles\WindowsPowerShell\DscService\RegistrationKeys.txt"
Contents = $RegistrationKey
}
}
}
#$guid = [guid]::NewGuid()
$guid = ‘regkey’
$cert = Get-ChildItem Cert:\LocalMachine\My
$filepath = 'C:\Program Files\WindowsPowerShell\DscService\Configuration\PullServer'
PullServer -RegistrationKey $guid -certificateThumbPrint $cert.Thumbprint -OutputPath $filepath
New-DscChecksum -Path $filepath
Start-DscConfiguration -Path $filepath -wait -Verbose -Force
LCM configuration file:
[DSCLocalConfigurationManager()]
Configuration LCM_Pull {
Node localhost {
Settings {
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Pull'
ConfigurationModeFrequencyMins = 15
RebootNodeIfNeeded = $true
}
ConfigurationRepositoryWeb PullServer {
ServerURL = 'https://DSC-Server/PsDscPullserver.svc'
AllowUnsecureConnection = $false
RegistrationKey = 'regkey'
ConfigurationNames = @('Webservice')
}
ResourceRepositoryWeb PullServerModules {
ServerURL = 'https://DSC-Server/PsDscPullserver.svc'
AllowUnsecureConnection = $false
RegistrationKey = 'regkey'
}
}
}
LCM_Pull -OutputPath "$env:SystemDrive\DscConfiguration"
Set-DscLocalConfigurationManager -Path "$env:SystemDrive\DscConfiguration" -Verbose -ComputerName localhost -Force