Hi,
I would be happy for some help.
I can’t get my client to load his config from the pull server.
1st. I setup a pullserver and ensure WinRM is working
Pullserver Testpage is ok, Test-WSman is also ok
# pre
Install-Module xPSDesiredStateConfiguration
Install-Module NetworkingDsc
Install-Module PSDscResources
Install-WindowsFeature RSAT-AD-Powershell
# Guid for RegistrationKey
[guid]::NewGuid()
# manual install Certificate for IIS
Configuration CreatePullServer
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$CertificateThumbPrint,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$RegistrationKey,
[Parameter()]
[ValidateRange(1, 65535)]
[System.UInt16]
$Port = 8080
)
Import-DscResource -ModuleName NetworkingDsc
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Node $NodeName
{
WindowsFeature DSCServiceFeature
{
Ensure = 'Present'
Name = 'DSC-Service'
}
xDscWebService PSDSCPullServer
{
Ensure = 'Present'
EndpointName = 'PSDSCPullServer'
Port = $Port
PhysicalPath = "$env:SystemDrive\inetpub\PSDSCPullServer"
CertificateThumbPrint = $CertificateThumbPrint
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
State = 'Started'
DependsOn = '[WindowsFeature]DSCServiceFeature'
RegistrationKeyPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService"
AcceptSelfSignedCertificates = $true
Enable32BitAppOnWin64 = $false
UseSecurityBestPractices = $true
ConfigureFirewall = $false
}
File RegistrationKeyFile
{
Ensure = 'Present'
Type = 'File'
DestinationPath = "$env:ProgramFiles\WindowsPowerShell\DscService\RegistrationKeys.txt"
Contents = $RegistrationKey
}
Firewall PSDSCPullServerRule
{
Ensure = 'Present'
Name = "DSC_PullServer_$Port"
DisplayName = "DSC PullServer $Port"
Group = 'DSC PullServer'
Enabled = $true
Action = 'Allow'
Direction = 'InBound'
LocalPort = $Port
Protocol = 'TCP'
DependsOn = '[xDscWebService]PSDSCPullServer'
}
}
}
md C:\DSC
CreatePullServer -Output c:\DSC
Start-DscConfiguration -Path C:\DSC -Wait -Verbose -Force
Then I set the client to pull - Config
Looks like the configuration is successfully transferred to the client. (Tested with Get-DscLocalConfigurationManager)
[DSCLocalConfigurationManager()]
configuration RegisterClientPull
{
[string[]]$NodeName = 'TestClient'
Node $NodeName
{
Settings
{
RefreshMode = 'Pull'
ConfigurationMode = 'ApplyAndAutoCorrect'
ConfigurationModeFrequencyMins = 15
RebootNodeIfNeeded = $true
}
ConfigurationRepositoryWeb Dorner-PullSrv
{
ServerURL = "https://Suppressed:8080/PSDSCPullServer.svc"
RegistrationKey = "SuppressedGUID"
ConfigurationNames = @('ClientConfig')
}
ResourceRepositoryWeb Dorner-PullSrv
{
ServerURL = "https://Suppressed:8080/PSDSCPullServer.svc"
}
ReportServerWeb Dorner-PullSrv
{
ServerURL = "https://Suppressed:8080/PSDSCPullServer.svc"
RegistrationKey = "SuppressedGUID"
}
}
}
RegisterClientPull -Output c:\DSC
# Create Checksum
New-DscChecksum "C:\DSC\*.mof"
Set-DscLocalConfigurationManager -Path C:\DSC\
PS C:\Windows\system32> Get-DscLocalConfigurationManager
ActionAfterReboot : ContinueConfiguration
AgentId : Suppressed
AllowModuleOverWrite : False
CertificateID :
ConfigurationDownloadManagers : {[ConfigurationRepositoryWeb]Dorner-PullSrv}
ConfigurationID :
ConfigurationMode : ApplyAndAutoCorrect
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 : True
RefreshFrequencyMins : 30
RefreshMode : Pull
ReportManagers : {[ReportServerWeb]Dorner-PullSrv}
ResourceModuleManagers : {[ResourceRepositoryWeb]Dorner-PullSrv}
PSComputerName :
I also made a TestClient.mof (which is the hostname) which works perfectly in PUSH mode.
Configuration Test
{
[string[]]$NodeName = 'TestClient'
Node $NodeName
{
somewhat
}
}
Test -Output "C:\Program Files\WindowsPowerShell\DscService\Configuration"
# Create Checksum
New-DscChecksum "C:\Program Files\WindowsPowerShell\DscService\Configuration\*.mof"
Start-DscConfiguration -Path "C:\Program Files\WindowsPowerShell\DscService\Configuration\"
But here starts the problem - the client does not pull and use his configuration.
I can force it from server site (push) with Start-DscConfiguration -Path "C:\Program Files\WindowsPowerShell\DscService\Configuration" -Wait -Verbose -Force but the Client is not pullig it from it self. I waited for an hour, but nothing happens…
Can someone help me out here? I read tutorials for days now, meanwhile im quite at the end of my knowledge.
BR and Thank you so much!
Mathias