Skip to content

Instantly share code, notes, and snippets.

@bobalob
Last active December 13, 2016 20:15
Show Gist options
  • Save bobalob/2a69b943c16e8f0392c468bc7c22ae20 to your computer and use it in GitHub Desktop.
Save bobalob/2a69b943c16e8f0392c468bc7c22ae20 to your computer and use it in GitHub Desktop.
Example to configure the LCM for pulling partial configurations using the ConfigurationID method
[DSCLocalConfigurationManager()]
configuration PullClientConfigNames
{
Node $AllNodes.NodeName
{
Settings
{
RefreshMode = 'Pull'
RefreshFrequencyMins = 30
RebootNodeIfNeeded = $true
ConfigurationID = $AllNodes.ConfigurationID
}
ConfigurationRepositoryWeb Master-PullSrv
{
ServerURL = 'https://pullserver.example.com:8080/PSDSCPullServer.svc'
CertificateID = 'SERVER-CERT-THUMBPRINT'
AllowUnsecureConnection = $False
}
PartialConfiguration "ServerBuild"
{
Description = "Server Build"
ConfigurationSource = @("[ConfigurationRepositoryWeb]Master-PullSrv")
}
PartialConfiguration "AppConfig"
{
Description = "Server Build"
ConfigurationSource = @("[ConfigurationRepositoryWeb]Master-PullSrv")
DependsOn = "[PartialConfiguration]ServerBuild"
}
}
}
$MyNodes =
@{
AllNodes =
@(
@{
NodeName = "pullclient.example.com"
ConfigurationID = "***use New-Guid to generate***"
}
);
}
PullClientConfigNames -OutPutPath C:\DSC\PullClient -ConfigurationData $MyNodes
Set-DscLocalConfigurationManager -Path C:\DSC\PullClient -verbose
Update-DscConfiguration -wait -verbose -ComputerName pullclient.example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment