Solved

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

Posted on 2013-07-01
8
482 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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this video we show how to create an email address policy 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…
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

772 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