Requirement: Quest ActiveDirectory Tools
Simple get group with Quest Tools
|
# Simple get group with Quest Tools Add-PSSnapin Quest.ActiveRoles.ADManagement get-QADGroupmember "Name of Group" | foreach-object {getqaduser $_} | Select Logonname,name,mail| Out-Gridview |
The above method took about 2min 5 seconds on a smaller group. I tend to use out-gridview so I can easily paste in Excel but you can remove that if you just want to see the results in console. This method is overly complex and takes more time than it should. See the below method for an optimized way to get the users. I need to give some credit a friend named Eduardo on this, he was the one that got me running measure-command{} today looking to the quickest method to run this query. My original thought was the above method only parsed members of the group and the lower method parsed all users. Clearly that is incorrect and the lower method is just grabbing members of the group.
Simplified and Optimized – The following takes 7.15 seconds
|
# Simple get group with Quest Tools Add-PSSnapin Quest.ActiveRoles.ADManagement Get-QADUser -Memberof "Name of Group" | Selet Logonname,name,mail | Out-GridView |
Some of the common fields you can select
givenname |
whencreated |
whenchanged |
mail |
email |
title |
userPrincipalName |
PasswordLastSet |
AccoutisDisabled |
AccoutIsLockedout |
dn |
MemberOf |
ParentContainer |
ParentContainerDN |
Description |
Return to the PowerShell Handbook
Like this:
Like Loading...