Often, administrators in a Windows environment will query the Active Directory for information. Whether it is the members of a group, all computers in a specific organizational unit, or all disabled user accounts, the Active Directory cmdlets have you covered.
This recipe shows you how to filter efficiently using the Active Directory cmdlets by searching for users in an Organizational Unit (OU) and for all disabled accounts using Lightweight Directory Access Protocol filters and PowerShell native filters.