Get all disabled users in specific OU's in Active Directory using Quest Powershell

I have begun running a script to pull all users that are disabled within multiple OU's can you let me know where i'm going wrong please?

Get-QADUser -Searchbase "OU=Enterprise Objects, DC=, DC=" - disabled
Who is Participating?
Will SzymkowskiSenior Solution ArchitectCommented:
As stated you can do this with native powershell cmdlets. See below command..
import-module activedirectory
Get-ADUser -Filter * -SearchBase "OU=Test,DC=domain,DC=com" -Properties Name, sAMAccountName, Enabled | ? {$_Enabled -eq $false} | select Name, sAMAccountName, Enabled | Export-csv "c:\disabledusers.csv" -NoTypeInformation

Open in new window

Jonathan BriteSystem AdminCommented:
why not just use the Search-ADAccount cmdlet from the Active Directory module:

"Search-ADAccount -AccountDisabled"
Jonathan BriteSystem AdminCommented:
here is a quick guide to help you install the Active Directory module for PowerShell.,2-801.html
JT3865Author Commented:
Thanks Will!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.