Pcornel
Automation · Windows Automation

User Management

Cheat sheet · https://pcornel.dk/topic.php?topic=5671

Back to the Topic

Answer

Windows User Management automates local account and local-group lifecycle while separating account object state, SID identity, group membership, credential handling and effective logon/authorization.

Remember

  • Account name exists ≠ expected SID identity.
  • Group membership written ≠ existing access token updated.
  • Administrator group membership ≠ current process elevated.
  • Account provisioned ≠ domain/application authorization correct.

First checks

  • Get-LocalUser; Get-LocalGroupMember Administrators — local accounts
  • New-LocalUser ... -WhatIf — preview
  • LAPS for local admin — password management

Verify in this order

source of truth → automation → accounts

Where it usually breaks

Local Windows account/group state does not establish domain IAM, application authorization or UAC elevation for an existing token.

User Management automation proof-boundary map

BoundaryHealthy evidenceSuspicious evidence
Scope / identityExact source revision, hosts and execution identity are explicitSelector drift, stale inventory or wrong token changes scope/authority
OperationTool/provider action and per-host result are traceablePartial failure, hidden error semantics or environment differences are lost
Platform statePersistent and effective state are read backCommand/cmdlet success is mistaken for convergence
Workload proofOriginal service/application acceptance passesAutomation summary substitutes for actual runtime behavior

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5671

Confirmation

Confirm action

Continue?