Solved

How run this script just for one OU?

Posted on 2012-03-09
1
442 Views
Last Modified: 2012-03-13
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
0
Comment
Question by:stowyo
1 Comment
 
LVL 27

Accepted Solution

by:
KenMcF earned 500 total points
ID: 37702679
Change your Get-QADUser to add this

-searchroot "OU=USER_ACCOUNTS,DC=DOAMIN,DC=LOCAL"
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
A procedure for exporting installed hotfix details of remote computers using powershell
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now