Automation · Active Directory Automation
Group Management
Cheat sheet · https://pcornel.dk/topic.php?topic=5688
Answer
Group management automation creates and maintains AD groups with New-ADGroup and Set-ADGroup, choosing scope (domain local, global, universal) and type (security or distribution) consistently.
Remember
- Group scope decides where members can come from and where the group can be used.
- Security groups grant access; distribution groups only send mail.
- A naming convention makes purpose and scope visible.
First checks
Get-ADGroup -Filter 'Name -like "role-*"'— role groupsNew-ADGroup -Name <n> -GroupScope Global -Path <OU> -WhatIf— create- Group naming and owner (ManagedBy) — governance
Verify in this order
request → group created with owner → used in ACLs
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5688