Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Drift · PowerShell DSC

Direct answer

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).

When to use this

Use this when DSC nodes drift from configuration.

First 30 seconds

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.

Operational verification

desired vs actual → drift → correct/alert

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
PowerShell Desired State Configuration
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformPowerShell Desired State Configuration · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when DSC nodes drift from configuration.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • The LCM detects drift on each consistency check.
  • ApplyAndMonitor reports drift.
  • ApplyAndAutoCorrect fixes it.
Key checks
  • 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.

ConfigurationModeBehaviour
ApplyOnlyApply once, never check
ApplyAndMonitorDetect and report drift
ApplyAndAutoCorrectDetect 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.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docPowerShell Desired State Configuration current

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%
Depth when you need it

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.

Confirmation

Confirm action

Continue?