Use this when changing many AD objects at once.
Bulk Operations
Bulk operations in AD change many objects at once, such as Get-ADUser -Filter ... | Set-ADUser. Filter precisely, test with -WhatIf, log every change and process in batches.
1. Bulk operations change many objects.
2. Always -WhatIf first.
3. Export before values for rollback.
4. Batch with logging.
5. Limit scope with precise filters.
filter → preview → batch changes → log
Context & applicabilityCommon mistakes · platform/version boundaries
Bulk Operations in Active Directory apply one transformation to many directory objects, so scope resolution and stable identity matter more than loop syntax. Distinguished names can move and display names are not unique; object GUID or another immutable key should anchor the intended target. The controller owns input parsing and action planning, while each domain controller owns the persisted directory update and replication state. Preserve input row, object GUID, requested change and per-object result.
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 Verify bulk AD changes with counts, immutable identities and replicated read-back Verify boundary
Verify a bounded AD bulk run by comparing planned object count with succeeded, skipped and failed counts; expect failed count 0 for the controlled run and every result to retain the object GUID or equivalent stable identity. Query a representative sample from the write DC and a replication partner and confirm the intended attribute value converges. Repeat the same input in dry-run or idempotent mode and expect no unintended additional changes. Matching totals alone do not show the correct objects were modified.
Step 2 Branch bulk AD failures at input validation, object resolution, authorization and replication Narrow the fault
If an AD bulk operation fails before changes begin, validate CSV or source schema and required fields. If some objects cannot be resolved, compare the immutable identifier and search base rather than widening the query. If resolution succeeds but writes fail, inspect delegated rights and attribute constraints for one object. If writes succeed on one DC but reads differ elsewhere, inspect replication. Stop the batch on systematic errors and preserve per-object status so partial success is not mistaken for atomic rollback.
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.
- Filter precisely before piping into Set- cmdlets.
- Run with -WhatIf first.
- Log every change for rollback.
Get-ADUser -Filter "Department -eq 'X'" | Set-ADUser -Office <o> -WhatIf— bulk preview- Batch size and logging — control
- Rollback data (before values) saved — recovery
ReferenceImportant terms & boundaries1 section · depth on demand
Method
Bulk operations apply the same change to many Active Directory objects — updating attributes, moving accounts, disabling stale computers, adding group memberships. They save hours but magnify mistakes, so they need preview, validation and logging.
Method:
1. Select objects with a precise filter and export the list for review.
2. Run with -WhatIf to show what would change.
3. Back up current values (export attributes to CSV) for rollback.
4. Apply in batches with per-object error handling and results logging.
5. Verify by re-querying.
$targets = Get-ADComputer -Filter 'LastLogonTimeStamp -lt $cutoff' -SearchBase $ou -Properties LastLogonTimeStamp
$targets | Select-Object Name, DistinguishedName | Export-Csv stale-before.csv -NoTypeInformation
$targets | Disable-ADAccount -WhatIf
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 > Bulk Operations. 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%