Use this when creating or maintaining AD groups by script.
Group Management
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.
1. Group management: create, describe, owner, scope.
2. Naming conventions.
3. ManagedBy for owners.
4. AGDLP model.
5. Remove empty/unused groups.
request → group created with owner → used in ACLs
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 ambiguous target identity, stale inputs, partial success, unsafe retry, permission drift and confusing tool completion with target-evidence of the actual state, choosing the cases most relevant to stable group identity, membership adds/removes, nested groups, scope/type and independent membership read-back.
Step 2 Common mistakes Narrow the fault
- Groups created without owner/description.
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.
- 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.
Get-ADGroup -Filter 'Name -like "role-*"'— role groupsNew-ADGroup -Name <n> -GroupScope Global -Path <OU> -WhatIf— create- Group naming and owner (ManagedBy) — governance
ReferenceWhy it matters1 section · depth on demand
What it is
Group management automates AD group creation and lifecycle with the ActiveDirectory module.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Group management automation keeps Active Directory group membership correct — role-based access groups, distribution lists, privileged groups — based on data from HR, a role model or requests. Accurate groups are what make access control reliable.
Add-ADGroupMember -Identity 'SG-Network-RO' -Members ahansen, bjensen
Remove-ADGroupMember -Identity 'SG-Network-RW' -Members ahansen -Confirm:$false
Get-ADGroupMember -Identity 'Domain Admins' -Recursive | Select-Object SamAccountName
# Sync membership with a source list
$want = Get-Content netops.txt
$have = (Get-ADGroupMember SG-NetOps).SamAccountName
Compare-Object $have $want
Log every change, protect privileged groups with extra approval, and run periodic access reviews comparing actual membership with expected membership.
Example
New-ADGroup -Name 'NET-Admins' -GroupScope Global -GroupCategory Security -Path 'OU=Groups,DC=corp,DC=local'
Get-ADGroup -Filter 'Name -like "NET-*"'
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Active Directory Automation > Group Management. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/module/activedirectory/?view=windowsserver2025-ps · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For stable group identity, membership adds/removes, nested groups, scope/type and independent membership read-back, prefer typed fields and stable IDs over human presentation text.