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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That'll work! Thanks!!!
Get-QADUser -enabled -searchroot 'domain.name/OU' | Select DN,Name, ParentContainer | Export-CSV filename.csv