dsccommunity / xPSDesiredStateConfiguration

DSC resources for configuring common operating systems features, files and settings.
https://dsccommunity.org
MIT License
211 stars 135 forks source link

ConfigurationNames - Multiple Values #118

Closed ArieHein closed 8 years ago

ArieHein commented 8 years ago

ConfigurationNames accepts multiple values in the definition but using more then one gave errors. This was in 3.7.0.0 Is this still the case now ? If so, is this something you plan on addressing to allow multiple values ? What was the the reason to only accept it on first registration and not constantly ?

I have opened an idea on UserVoice to change the way ConfigurationNames work to both allow mutiple values and also accepts changes to its values constantly and not just on registration.

NarineM commented 8 years ago

Currently we support only one value in ConfigurationNames in full configuration scenarios. Multiple names are only accepted in partial configurations scenario.

ArieHein commented 8 years ago

Partial Configurations isnt supported or possible (atm) via AgentID regsitration though. So i need to use ConfigurationID, but using that means i cant use ConfigurationNames or am i missing something or the documentation is ?

NarineM commented 8 years ago

hi @ArieHein Here is an example of meta configuration script that uses multiple configuration names with agent id and partial configurations:

[DscLocalConfigurationManager()] Configuration RegistrationMetaConfigWithPartials { Settings { RefreshFrequencyMins = 30; RefreshMode = "PULL"; ConfigurationMode =”ApplyAndAutocorrect“; AllowModuleOverwrite = $true; RebootNodeIfNeeded = $true; ConfigurationModeFrequencyMins = 60; } ConfigurationRepositoryWeb ConfigurationManager { ServerURL = $serverURL AllowUnsecureConnection = $true
RegistrationKey = $registrationKey
ConfigurationNames = @("Part1", "Part2") }

    PartialConfiguration Part1 
    {
        Description = "Part1"
        ConfigurationSource = @("[ConfigurationRepositoryWeb]ConfigurationManager") 
    }

    PartialConfiguration Part2
    {
        Description = "Part2"
        ConfigurationSource = @("[ConfigurationRepositoryWeb]ConfigurationManager")
    }

}

RegistrationMetaConfigWithPartials

Set-DscLocalConfigurationManager -ComputerName localhost -Path .\RegistrationMetaConfigWithPartials –Verbose

Zuldan commented 8 years ago

@NarineM. Thank you for the example. What would be the naming convention for AgentID partial config mof files? As you know ConfigID partial config mofs are ConfigName.ConfigID.mof

I'm guessing ConfigName.AgentID.mof ?

NarineM commented 8 years ago

@Zuldan It would by just ConfigName.mof.

ArieHein commented 8 years ago

Thanks Narine. This was already discussed on powershell.org after a blogger posted his successful results and after another person mentioned it.

It seems it has been fixed between my original post and now.

Thanks for the update in here as well.