Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

PowerShell AD Module

Direct answer

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.

When to use this

Use this when using the ActiveDirectory PowerShell module.

First 30 seconds

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.

Operational verification

cmdlet → ADWS (9389) → DC

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Active Directory automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformActive Directory automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when using the ActiveDirectory PowerShell module.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • Installed with RSAT or on DCs.
  • Uses Active Directory Web Services on DCs.
  • Filters run server-side; use them.
Key checks
  • Get-Command -Module ActiveDirectory | measure — cmdlets
  • Get-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.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docActive Directory automation current

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%
Confirmation

Confirm action

Continue?