Skip to content

Prevent WDAGUtilityAccount password expiration in new baselines - #6

Merged
rkttu merged 4 commits into
mainfrom
copilot/prevent-wdag-utility-account-password-expiration
Sep 4, 2026
Merged

rkttu merged 4 commits into
mainfrom
copilot/prevent-wdag-utility-account-password-expiration

Conversation

Copilot AI commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Long-lived baselines could stop automatic RDP logon when WDAGUtilityAccount reached the Windows password-age limit. Existing baselines require rebuilding to receive the corrected account configuration.

  • Account provisioning

    • Set the credential and account-scoped expiration policy in one chained command:
      Set-LocalUser -Name 'WDAGUtilityAccount' -PasswordNeverExpires $true
    • Use native 64-bit Windows PowerShell.
    • Leave global password-age and account-expiration policies unchanged.
  • Failure handling

    • Write a readiness marker only after credential and expiration configuration succeeds.
    • Gate baseline shutdown on that marker, preventing failed provisioning from producing a ready baseline.
    • Account for concurrent FirstLogonCommands execution by waiting for readiness before finalization.
  • Migration

    • Document that provisioning updates do not alter existing images and affected users must rebuild their baseline.

Copilot AI and others added 2 commits September 4, 2026 06:29
Co-authored-by: rkttu <1297346+rkttu@users.noreply.github.com>
Co-authored-by: rkttu <1297346+rkttu@users.noreply.github.com>
Copilot AI changed the title [WIP] Prevent WDAGUtilityAccount password expiration from breaking old baselines Prevent WDAGUtilityAccount password expiration in new baselines Sep 4, 2026
Copilot AI requested a review from rkttu September 4, 2026 06:35
…utility-account-password-expiration

# Conflicts:
#	src/MacSandbox/Core/UnattendBuilder.swift

Co-authored-by: rkttu <1297346+rkttu@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@rkttu
rkttu marked this pull request as ready for review September 4, 2026 07:22
Copilot AI lite review requested due to automatic review settings September 4, 2026 07:22
@rkttu
rkttu merged commit bff90d4 into main Sep 4, 2026
1 check was pending
@rkttu
rkttu deleted the copilot/prevent-wdag-utility-account-password-expiration branch September 4, 2026 07:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The provisioning command currently embeds the password unquoted (brittle for future credential formats) and the architecture docs contain a now-inaccurate firewall description.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates Windows baseline provisioning so the internal WDAGUtilityAccount password does not expire (preventing long-lived baselines from failing automatic RDP logon), and documents the required rebuild for existing baselines.

Changes:

  • Replace global password-age policy changes with account-scoped Set-LocalUser -PasswordNeverExpires $true during OOBE provisioning.
  • Add a readiness marker + gated shutdown to avoid finalizing a baseline when account provisioning fails (accounting for FirstLogonCommands concurrency).
  • Document that provisioning changes do not retrofit existing baselines and users must rebuild.
File summaries
File Description
src/MacSandbox/Core/UnattendBuilder.swift Implements account-scoped non-expiring password configuration and gates baseline shutdown on a provisioning-ready marker.
docs/help.md Documents that users must rebuild baselines to pick up provisioning improvements (including non-expiring WDAGUtilityAccount password).
ARCHITECTURE.md Updates provisioning flow documentation to include PasswordNeverExpires gating behavior.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +35 to +42
let accountReadyMarker = "C:\\ProgramData\\MacSandbox-WDAGUtilityAccount.ready"
let accountSetupCommand = """
$ErrorActionPreference = 'Stop'
& net.exe user WDAGUtilityAccount \(rdpPassword)
if ($LASTEXITCODE -ne 0) { throw 'Could not set the WDAGUtilityAccount password.' }
Set-LocalUser -Name 'WDAGUtilityAccount' -PasswordNeverExpires $true
Set-Content -LiteralPath '\(accountReadyMarker)' -Value 'ready' -Encoding Ascii
"""
Comment thread ARCHITECTURE.md
Comment on lines +59 to 61
bootstrap admin auto-logon → FirstLogonCommands enable the built-in **WDAGUtilityAccount**, set its RDP credential,
disable password expiration for that account, and **enable the RDP server** (`fDenyTSConnections=0`, NLA off, `LimitBlankPasswordUse=0`,
allow the firewall remote-desktop group) + configure the logon agent (Run key) → `shutdown` → baseline complete (status=ready).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent WDAGUtilityAccount password expiration from breaking old baselines

4 participants