Link to home
Start Free TrialLog in
Avatar of amendala
amendala

asked on

Please provide a Powershell script to find all the user accounts in a specific OU that are ENABLED.

Folks -

I'm looking for a powershell script that will search a specific OU in Active Directory and return the CN of all USER accounts that are ENABLED.  The script should ignore groups and all other non-user account objects.

I want to do this using only built-in Cmdlets.  I'm aware that there are prebuilt Cmdlets that can do this for me but I don't trust them.

Thanks.
Avatar of LindyS
LindyS
Flag of United States of America image

Even though you don't trust addins, Quest Active roles shell makes this really simple.

Get-QADUser -enabled -searchroot 'domain.name/OU' | Select DN,Name, ParentContainer | Export-CSV filename.csv
ASKER CERTIFIED SOLUTION
Avatar of KenMcF
KenMcF
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amendala
amendala

ASKER

That'll work!  Thanks!!!