Solved

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

Posted on 2013-07-01
8
486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

691 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