Automation · Windows Automation
User Management
Cheat sheet · https://pcornel.dk/topic.php?topic=5671
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 accountsNew-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
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Scope / identity | Exact source revision, hosts and execution identity are explicit | Selector drift, stale inventory or wrong token changes scope/authority |
| Operation | Tool/provider action and per-host result are traceable | Partial failure, hidden error semantics or environment differences are lost |
| Platform state | Persistent and effective state are read back | Command/cmdlet success is mistaken for convergence |
| Workload proof | Original service/application acceptance passes | Automation 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