Avatar of Todd Mostowy
Todd Mostowy
Flag 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
Powershell

Avatar of undefined
Last Comment
KenMcF

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
KenMcF

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy