2
votes

I have 2 servers set up for DSC, Both running Powershell 5.0 and Server 12 R2, DSCPULL is configured as a DSC Pull Server over HTTP, DSCIIS is the client.

On DSCIIS i am trying to set it up so that it downloads the config from the Pull server via a configuration names, i have taken code from the MSDN website and altered slightly to my requirements but it still isn't working.

[DSCLocalConfigurationManager()]
configuration PullClientConfigID
{
    Node localhost
    {
        Settings
        {
            RefreshMode = 'Pull'
            RefreshFrequencyMins = 30 
            RebootNodeIfNeeded = $true
        }

        ConfigurationRepositoryWeb DSCPULL
        {
            ServerURL = 'http://DSCPULL:8080/PSDSCPullServer.svc'
            RegistrationKey = 'test'
            ConfigurationNames = @('WebServer')
            AllowUnsecureConnection = $true
        }
    }
}

PullClientConfigID -OutputPath c:\Configs\TargetNodes
Start-DscConfiguration C:\Configs\TargetNodes -ComputerName localhost -wait -Verbose

The error i receive is

Start-DscConfiguration : The computer-specific MOF file for computer localhost does not exist in the current directory.
At line:1 char:1
+ Start-DscConfiguration C:\Configs\TargetNodes -ComputerName localhost ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Start-DscConfiguration], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.DesiredStateConfiguration.Commands.StartDscConfiguration 
   Command

I have tried changing "Node Localhost" to the server name and then run the last line with the correct "ComputerName" but i get the same error.

1

1 Answers

1
votes

I should have been using Set-DSCLocalConfigurationManager not Start-DSCConfiguration

Set-DSCLocalConfigurationManager localhost –Path C:\Configs\TargetNodes –Verbose