Solved

need assistance with a Quest AD CMDlet script - need to add additional attributes in the search

Posted on 2013-07-01
8
481 Views
Last Modified: 2013-07-01
when i run the following command, it does not pickup attributes like: "distinguishedName / employeeID/ pwdLastSet .. etc"

how can i modify the script to pickup and report on these values:

Get-Qaduser -SizeLimit 0 -SearchRoot $OU | 
select 

mail,sAMAccountName,displayName,telephoneNumber,mobile,l,givenName,sn,distinguishedName,employeeID,description,manager,pwdLastSet,whenCreated,accountExpires,badPasswordCount,badPasswordTime

Open in new window

0
Comment
Question by:siber1
  • 4
  • 4
8 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39290856
Try..
Get-Qaduser -SizeLimit 0 -SearchRoot $OU -all | 
select mail,sAMAccountName,displayName,telephoneNumber,mobile,l,givenName,sn,distinguishedName,employeeID,description,manager,pwdLastSet,whenCreated,accountExpires,badPasswordCount,badPasswordTime

Open in new window

0
 

Author Closing Comment

by:siber1
ID: 39290863
thanks Subsun, i forgot about the -all switch.

appreciate it.
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39290879
FYI, Parameter -all may cause lot of memory utilization if you have large number of users in the SearchRoot. In that case you can use -IncludedProperties and add only required properties..
0
 

Author Comment

by:siber1
ID: 39290890
thx Subsun. where specifically would i add the -IncludedProperties value in that script?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:siber1
ID: 39290925
Subsun, would this be correct for using the -IncludedProperties value:

# Instruction to add Quest Powershell Snap-in
Add-PSSnapin quest.ActiveRoles.admanagement
$OU="mydomain.com/Corp Accounts/Users"
$Logfile="C:\temp\result.csv"
Get-Qaduser -SizeLimit 0 -SearchRoot $OU -IncludedProperties mail,sAMAccountName,displayName,telephoneNumber,mobile,l,givenName,sn,distinguishedName,employeeID,description,manager,pwdLastSet,whenCreated,accountExpires,badPasswordCount,badPasswordTime | 
select mail,sAMAccountName,displayName,telephoneNumber,mobile,l,givenName,sn,distinguishedName,employeeID,description,manager,pwdLastSet,whenCreated,accountExpires,badPasswordCount,badPasswordTime | ? {$_.l -eq "UK"}|
Export-Csv $Logfile -NoTypeInformation

Open in new window

0
 
LVL 40

Expert Comment

by:Subsun
ID: 39290938
Get-QADUser -DontUseDefaultIncludedProperties -IncludedProperties mail,sAMAccountName,displayName,telephoneNumber,mobile,l,givenName,sn,distinguishedName,employeeID,description,manager,pwdLastSet,whenCreated,accountExpires,badPasswordCount,badPasswordTime -SizeLimit 0 -SearchRoot $OU | 
select mail,sAMAccountName,displayName,telephoneNumber,mobile,l,givenName,sn,distinguishedName,employeeID,description,manager,pwdLastSet,whenCreated,accountExpires,badPasswordCount,badPasswordTime

Open in new window

Ref :
http://ss64.com/ps/get-qaduser.html

http://dmitrysotnikov.wordpress.com/2007/07/24/optimize-powershell-performance-and-memory-consumption/
0
 

Author Comment

by:siber1
ID: 39291046
thx Subsun, that worked perfectly.
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39291059
You're welcome!.. :-)
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
how to add IIS SMTP to handle application/Scanner relays into office 365.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

911 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

19 Experts available now in Live!

Get 1:1 Help Now