Link to home
Start Free TrialLog in
Avatar of Todd Mostowy
Todd MostowyFlag for United States of America

asked on

How run this script just for one OU?

I use this script for my AD user reviews and would like to run it on users in just one OU and the OU's listed under that.  So how do I do this and list that OU in the output?  Here is the script.

using Activeroles AD management shell (x64)

Get-QADUser -IncludedProperties userAccountControl, WhoCreatedBy -SizeLimit 0 | Select-Object SamAccountName, LastName, FirstName, HomeDrive, HomeDirectory, PasswordLastChanged, PasswordNeverExpires, PasswordLastSet, PasswordExpires, AccountExpires, AccountIsLockedOut, LastLogon, WhenCreated, WhoCreatedBy, @{n='UserAccountStatus';e={ $_.UserAccountControl }}, @{n='Groups';e={ $_ | Get-QADMemberOf | Select-Object -ExpandProperty Name }} | Export-Csv "20120125a.csv" -NoTypeInformation
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