Something like this might help: get-qaduser|where {$_.dn -match "Q2" -and $_.dn -match "Q3"}
Christopher Bodnar Enterprise Architect I, Corporate Office of Technology:Enterprise Architecture and Engineering Services Tel 610-807-6459 3900 Burgess Place, Bethlehem, PA 18017 christopher_bod...@glic.com The Guardian Life Insurance Company of America www.guardianlife.com From: Michael Leone <oozerd...@gmail.com> To: "NT System Admin Issues" <ntsysadmin@lyris.sunbelt-software.com> Date: 02/21/2013 11:40 AM Subject: Powershell with Quest advice - show all disabled users, but only in a certain OU I'm still trying to get the hang of this. Here's what I need - a report of all user accounts that are in just certain OUs. Specifically - we have an OU called "Disabled" where we put disabled user accounts. There are 4 sub-OUs - Q1, Q2, etc. And what I want is only the accounts in Q2 and Q3. HOWEVER, when a user is on a leave of absence, we disable their accoutn, but do NOT move it into the "Disabled" OU. I know I can use Get-QADUser -Disabled -SearchRoot "OU=Disabled in Q3,OU=DISABLED,DC=...DC=...,DC=...,DC=...,DC=..." Which gives me that one sub-OU. Will I just have to repeat it for just Q2? OR ... is there some way I can search the DISABLED OU, and just filter out Q1 and Q4? Also: there doesn't seem to be an entry for "DisabledDate", I only see last modification date (which ideally will work out to be the same thing as disabled date). It's not critical for me, but is there a way to list date the account was disabled? I plan to write all this out into an Excel spreadsheet, which I've done before. Any advice gratefully appreciated. ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to listmana...@lyris.sunbeltsoftware.com with the body: unsubscribe ntsysadmin ----------------------------------------- This message, and any attachments to it, may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are notified that any use, dissemination, distribution, copying, or communication of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately by return e-mail and delete the message and any attachments. Thank you. ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to listmana...@lyris.sunbeltsoftware.com with the body: unsubscribe ntsysadmin
<<image/jpeg>>