ActiveDirectory module: setup and commands
Documentation: Microsoft Learn
Query users, groups and computers with Get-ADUser and Get-ADGroup, then avoid broad searches by choosing a search base and requested properties.
Getting it
Not present by default. Add it with Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools on Windows 10 or 11, or Install-WindowsFeature RSAT-AD-PowerShell on Windows Server.
Examples
Show reference output
Show reference output
What it is for
Use it for anything living in an on-premises domain, from account lifecycle work through replication health checks. It is also the fastest route to bulk reporting, because -Filter and -LDAPFilter push the selection work onto a domain controller.
Typical tasks
- Report accounts inactive past a cutoff date
- Audit membership of privileged groups
- Find computers with stale last logon values
- Check replication partner failure counts
- Bulk update attributes from a CSV
- Locate the current FSMO role holders
Check the installed version
Compare the module path and version with the session used by your scheduled task or automation account. Use it for anything living in an on-premises domain, from account lifecycle work through replication health checks. It is also the fastest route to bulk reporting, because -Filter and -LDAPFilter push the selection work onto a domain controller.