Use this when DSC nodes drift from configuration.
Drift · PowerShell DSC
Drift in DSC is when a node no longer matches its configuration. The LCM detects it on each consistency check and either reports it (ApplyAndMonitor) or fixes it (ApplyAndAutoCorrect).
1. Drift: actual settings differ from DSC configuration.
2. Detect with Test-DscConfiguration.
3. Auto-correct or alert.
4. Find who changes settings manually.
5. Avoid conflicts with GPO.
desired vs actual → drift → correct/alert
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as resource module drift, duplicate/ambiguous keys, credentials in artifacts, reboot/pending-state handling, push/pull source drift and resource reporting success without actual convergence, choosing the cases most relevant to desired-versus-actual comparison, normalization, ignored/computed fields, drift ownership and safe convergence rather than blind Set/reapply.
Step 2 Common mistakes Narrow the fault
- ApplyAndMonitor mode expected to fix drift.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- The LCM detects drift on each consistency check.
- ApplyAndMonitor reports drift.
- ApplyAndAutoCorrect fixes it.
Test-DscConfiguration -Detailed | select -Expand ResourcesNotInDesiredState— drifted resources- ApplyAndAutoCorrect mode — auto-fix
- Drift alerts — monitoring
ReferenceWhy it matters1 section · depth on demand
What it is
DSC drift is detected with Test-DscConfiguration and corrected automatically when LCM mode is ApplyAndAutoCorrect.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Drift in DSC is when a node's actual configuration no longer matches its assigned configuration — someone stopped a service or changed a setting. The Local Configuration Manager detects it during periodic consistency checks and, depending on the configuration mode, reports or corrects it.
| ConfigurationMode | Behaviour |
|---|---|
| ApplyOnly | Apply once, never check |
| ApplyAndMonitor | Detect and report drift |
| ApplyAndAutoCorrect | Detect and fix drift |
Test-DscConfiguration -Detailed | Select-Object -ExpandProperty ResourcesNotInDesiredState
Get-DscConfigurationStatus
Start with ApplyAndMonitor to see how often drift occurs and why, then switch to AutoCorrect for settings that should never change.
Example
Test-DscConfiguration -Detailed
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in PowerShell DSC > Drift. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/dsc/overview?view=dsc-3.0 · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For desired-versus-actual comparison, normalization, ignored/computed fields, drift ownership and safe convergence rather than blind Set/reapply, prefer typed fields and stable IDs over human presentation text.