Setting up a pull client using configuration ID in PowerShell 4.0

2 minutes to read

Contributors

In this article

Applies To: Windows PowerShell 4.0, Windows PowerShell 5.0

Each target node has to be told to use pull mode and given the URL where it can contact the pull server to get configurations. To do this, you have to configure the Local Configuration Manager (LCM) with the necessary information. To configure the LCM, you create a special type of configuration known as a "metaconfiguration". For more information about configuring the LCM, see Windows PowerShell 4.0 Desired State Configuration Local Configuration Manager

The following script configures the LCM to pull configurations from a server named "PullServer":

In the script, DownloadManagerCustomData passes the URL of the pull server and (for this example) allows an unsecured connection.

After this script runs, it creates a new output folder called SimpleMetaConfigurationForPull and puts a metaconfiguration MOF file there.

To apply the configuration, use Set-DscLocalConfigurationManager with parameters for ComputerName (use “localhost”) and Path (the path to the location of the target node’s localhost.meta.mof file). For example:

Configuration ID

The script sets the ConfigurationID property of the LCM to a GUID that had been previously created for this purpose (you can create a GUID by using the New-Guid cmdlet). The ConfigurationID is what the LCM uses to find the appropriate configuration on the pull server. The configuration MOF file on the pull server must be named ConfigurationID.mof, where ConfigurationID is the value of the ConfigurationID property of the target node's LCM.

Pulling from an SMB server

If the pull server is set up as an SMB file share, rather than a web service, you specify the DscFileDownloadManager rather than the WebDownLoadManager.
The DscFileDownloadManager takes a SourcePath property instead of ServerUrl. The following script configures the LCM to pull configurations from an SMB share named
"SmbDscShare" on a server named "CONTOSO-SERVER":

See Also

The feedback system for this content will be changing soon. Old comments will not be carried over. If content within a comment thread is important to you, please save a copy. For more information on the upcoming change, we invite you to read our blog post.