Author Posts

April 19, 2017 at 2:05 pm

I managed to get a pull server set up, now I'm trying a simple configuration to test it.

I have generated the mof file with the name I want to install rsat-dns windows feature. I'm now trying to setup the lcm to pull the config.

The example from the dsc book replaced with my settings.

[DSCLocalConfigurationManager()]

Configuration LCM_Pull {

Node CLI1 {

Settings {
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Pull'
}

ConfigurationRepositoryWeb PullServer {
ServerURL = 'http://pull:8080/PsDscPullserver.svc'
AllowUnsecureConnection = $False
RegistrationKey = '0f9ae841-785d-4a2d-8cdf-ecae01f44cdb'
ConfigurationNames = @('TimeZoneConfig')
}

ResourceRepositoryWeb PullServerModules {
ServerURL = 'http://pull:8080/PsDscPullserver.svc'
AllowUnsecureConnection = $True
RegistrationKey = '0f9ae841-785d-4a2d-8cdf-ecae01f44cdb'
}
}
}

LCM_Pull

When I run this I get.

At line:1 char:1
+ [DSCLocalConfigurationManager()]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected attribute 'DSCLocalConfigurationManager'.
At line:2 char:1
+ Configuration LCM_Pull {
+ ~~~~~~~~~~~~~
Unexpected token 'Configuration' in expression or statement.
At line:2 char:24
+ Configuration LCM_Pull {
+ ~
Missing closing '}' in statement block.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedAttribute

What am I doing wrong? 🙁

April 19, 2017 at 2:23 pm

I don't know why but use this and give me the result

[DSCLocalConfigurationManager()]
configuration PullClient
{
Node localhost
{
Settings
{
RefreshMode = 'Pull'
RefreshFrequencyMins = 30
RebootNodeIfNeeded = $true
ConfigurationMode = 'ApplyAndAutoCorrect'
ConfigurationModeFrequencyMins = 15
}
ConfigurationRepositoryWeb DSC-Pull
{
ServerURL = 'http://pull:8080/PSDSCPullServer.svc'
RegistrationKey = 'RegistrationKey'
ConfigurationNames = @('service')
AllowUnsecureConnection = $true #Use this parameter only if you do not have a certificate installed on the pull server
}

ReportServerWeb DSC-Pull
{
ServerURL = 'http://pull:8080/PSDSCPullServer.svc'
RegistrationKey = 'RegistrationKey'
AllowUnsecureConnection = $true
}
}
}
PullClient
Set-DSCLocalConfigurationManager localhost –Path .\PullClient –Verbose

April 19, 2017 at 2:27 pm

[DSCLocalConfigurationManager()]
configuration PullClient
{
Node localhost
{
Settings
{
RefreshMode = 'Pull'
RefreshFrequencyMins = 30
RebootNodeIfNeeded = $true
ConfigurationMode = 'ApplyAndAutoCorrect'
ConfigurationModeFrequencyMins = 15
}
ConfigurationRepositoryWeb DSC-Pull
{
ServerURL = 'http://pull:8080/PSDSCPullServer.svc'
RegistrationKey = 'RegistrationKey'
ConfigurationNames = @('service')
AllowUnsecureConnection = $true #Use this parameter only if you do not have a certificate installed on the pull server
}

ReportServerWeb DSC-Pull
{
ServerURL = 'http://pull:8080/PSDSCPullServer.svc'
RegistrationKey = 'RegistrationKey'
AllowUnsecureConnection = $true
}
}
}
PullClient
Set-DSCLocalConfigurationManager localhost –Path .\PullClient –Verbose

April 19, 2017 at 2:28 pm

Unexpected attribute 'DSCLocalConfigurationManager'.
At line:1 char:1
+ [DSCLocalConfigurationManager()]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected attribute 'DSCLocalConfigurationManager'.

At line:2 char:1
+ configuration PullClient
+ ~~~~~~~~~~~~~
Unexpected token 'configuration' in expression or statement.

At line:5 char:1
+ {
+ ~
Missing closing '}' in statement block.

At line:3 char:1
+ {
+ ~
Missing closing '}' in statement block.

At line:6 char:1
+ Settings
+ ~~~~~~~~
Undefined DSC resource 'Settings'. Use Import-DSCResource to import the resource.

At line:14 char:1
+ ConfigurationRepositoryWeb DSC-Pull
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
Undefined DSC resource 'ConfigurationRepositoryWeb'. Use Import-DSCResource to import the resource.

ReportServerWeb : The term 'ReportServerWeb' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ ReportServerWeb DSC-Pull
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (ReportServerWeb:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Missing closing '}' in statement block.

April 19, 2017 at 2:31 pm

where do you execute your LCM?

April 19, 2017 at 2:44 pm

On the pull server itself. Is this possible?

April 19, 2017 at 2:52 pm

yes it's possible. so delete this line [DSCLocalConfigurationManager()]

your LCM will be like:


Configuration LCM_Pull {

Node CLI1 {

Settings {
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Pull'
}

ConfigurationRepositoryWeb PullServer {
ServerURL = 'http://pull:8080/PsDscPullserver.svc'
AllowUnsecureConnection = $False
RegistrationKey = '0f9ae841-785d-4a2d-8cdf-ecae01f44cdb'
ConfigurationNames = @('TimeZoneConfig')
}

ResourceRepositoryWeb PullServerModules {
ServerURL = 'http://pull:8080/PsDscPullserver.svc'
AllowUnsecureConnection = $True
RegistrationKey = '0f9ae841-785d-4a2d-8cdf-ecae01f44cdb'
}
}
}

LCM_Pull

April 19, 2017 at 3:24 pm

No dice on the pull server itself.

+ Settings {
+ ~~~~~~~~
Undefined DSC resource 'Settings'. Use Import-DSCResource to import the resource.

I was able to get it to work on my workstation yet I have to now figure out this. Winrm is enabled, test-wsman works, 8080 is open and I can browse to the site through chrome.

The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running
destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".
+ CategoryInfo : ConnectionError: (root/Microsoft/...gurationManager:String) [], CimException

April 19, 2017 at 5:39 pm

Thanks for your help. I got it by installing wmf 5.1, deleting the site and starting over supplying wwwroot where the MS example didn't have it. I now see yellow! 🙂

Now on to figuring out how to setup the reporting portion.

April 20, 2017 at 12:55 pm

I didn't follow the thread or result completely, but if you're trying to define settings for an LCM, you do need the
[DSCLocalConfigurationManager()]

declaration. That is how it knows to generate a meta-mof instead of a real MOF. Also (as you saw) the settings keyword isn't available in a regular configuration, only in an LCM configuration.

April 21, 2017 at 5:08 pm

Yep 5.1 did the trick. I didn't change anything in the config script and it processed without error after the upgrade.

Dan