Solved

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

Posted on 2013-07-01
8
480 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

708 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