Use this when using the ActiveDirectory PowerShell module.
PowerShell AD Module
The PowerShell ActiveDirectory module (part of RSAT) provides cmdlets such as Get-ADUser, New-ADUser, Set-ADGroup and Search-ADAccount for reading and changing AD from scripts.
1. PowerShell AD module (RSAT/AD DS tools).
2. Use -Filter (server-side) not Where-Object for large queries.
3. -Properties only needed attributes.
4. Target a specific DC for consistency.
5. Handle replication delay.
cmdlet → ADWS (9389) → DC
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 Common mistakes Narrow the fault
- ADWS port 9389 blocked.
- Not specifying
-Server, hitting a far DC.
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.
- Installed with RSAT or on DCs.
- Uses Active Directory Web Services on DCs.
- Filters run server-side; use them.
Get-Command -Module ActiveDirectory | measure— cmdletsGet-ADDomain— domain info- -Server <dc> to target a DC — consistency
ReferenceWhy it matters1 section · depth on demand
What it is
The ActiveDirectory PowerShell module (RSAT) provides Get-AD*/Set-AD* cmdlets that talk to AD Web Services (TCP 9389) on a DC.
ReferenceHow it works1 section · depth on demand
In depth
The ActiveDirectory PowerShell module (part of RSAT) is the main tool for scripting AD: users, groups, computers, OUs, password policies and more. It talks to domain controllers through Active Directory Web Services (TCP 9389).
Import-Module ActiveDirectory
Get-ADUser -Filter 'Enabled -eq $true -and LastLogonDate -lt $cutoff' -Properties LastLogonDate
Get-ADComputer -Filter 'OperatingSystem -like "*Server*"' -SearchBase 'OU=Servers,DC=corp,DC=example,DC=com'
Set-ADUser ahansen -Department 'Network' -Title 'Engineer'
Use -Filter (server-side) instead of fetching everything and filtering with Where-Object; request extra attributes explicitly with -Properties; and target a specific domain controller (-Server) in scripts that create then immediately modify objects, to avoid replication delays.
ReferenceImportant terms & boundaries2 sections · depth on demand
Platform, version and operating-envelope scope
PowerShell 5.1/7+, module versions and remoting endpoint behavior vary by host/platform.
Example
Import-Module ActiveDirectory
Get-ADUser alice -Properties memberOf,lastLogonDate -Server dc01
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 > PowerShell AD Module. 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%