Push Configuration
Push Server Configuration¶
In PowerShell Desired State Configuration (DSC), a push server is not a standard feature like the pull server. Instead, the push model refers to manually applying configurations to target nodes using the DSC Local Configuration Manager (LCM) or other tools. This approach contrasts with the pull model, where nodes automatically retrieve configurations from a central server. This section covers how to configure and manage DSC configurations using push mechanisms, including manual application and LCM settings.
Setting Up a Push Configuration¶
To use the push model, you typically apply configurations directly to target nodes using PowerShell. This method is useful for one-time or ad-hoc configuration changes. Here’s how to set it up:
1. Create a DSC Configuration Script¶
Define the desired state using a DSC configuration script. For example:
Configuration SetDiskQuota {
Node 'TargetNode' {
File DiskQuota {
DestinationPath = 'C:\Quota'
Ensure = 'Present'
Type = 'Directory'
}
}
}
2. Compile the Configuration¶
Generate a .mof file that represents the desired state:
3. Apply the Configuration to a Node¶
Use Start-DscConfiguration to push the configuration to a target node:
Configuring the LCM for Push Operations¶
The LCM on the target node must be configured to accept push configurations. This is typically done via the LocalConfigurationManager settings:
Example: Configure LCM to Accept Push Configurations¶
[DSCLocalConfigurationManager()]
configuration LCMConfig {
Node localhost {
Settings {
RefreshMode = 'Push'
ConfigurationMode = 'ApplyAndMonitor'
}
}
}
LCMConfig
After applying this configuration, the LCM will be ready to receive push-based updates.
Managing Push Configurations¶
Monitoring Status¶
Use Test-DscConfiguration to verify if a node is in the desired state:
Troubleshooting¶
- Configuration drift: Use
Get-DscConfigurationto check the current state. - Failed applications: Review logs in
C:\Windows\System32\winevt\Logs\Microsoft-Windows-DSC%4Operational.
Key Takeaways¶
- The push model in DSC involves manually applying configurations to nodes using
Start-DscConfigurationor LCM settings. - Pull servers are the standard method for centralized configuration management, while push is used for ad-hoc tasks.
- Always validate configurations with
Test-DscConfigurationand monitor node compliance regularly. - Ensure the LCM is configured with
RefreshMode = 'Push'for manual push operations.