Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Re: List all Group Users in AD

Reply
 
Old 09-02-2008   #1 (permalink)
Shay Levy [MVP]


 
 

Re: List all Group Users in AD

Hi chris,

Yes, sorry for that

Add an ldap filter to Get-QADGroup to return none empty groups only:

Get-QADGroup -sizeLimit 0 -ldap '(member=*)' | select ...



---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic



c> Actually..take that back. Got it to run. Only question is now...it
c> looks to hate empty group as it gives this err
c>
c> Select-Object : Cannot expand property "members" because it has
c> nothing to
c> expand.
c> At line:1 char:35
c> + Get-QADGroup -sizeLimit 0 | select <<<<
c> @{name="GroupName";expression={$_.name}} -expand members | select
c> GroupName,
c> @{n='Member';e={ (Get-QADObject $_).name
c> I'll play w/ it too..And, again. Thanks!!!
c> "Chris" wrote:
Quote:
Quote:

>> Shay,
>> Thanks for the post and help as well. But, when trying to run your
>> script,
>> it is only pulling groups. Your output is the exact format I'm
>> looking to
>> accomplish tho!!
>> Thanks!
>> --Chris
>> "Shay Levy [MVP]" wrote:
>>
Quote:

>>> Hello chris,
>>>
>>> Here's another way (one line):
>>>
>>> PS > Get-QADGroup -sizeLimit 0 | select
>>> @{name="GroupName";expression={$_.name}} -expand members | select
>>> GroupName,@{n='Member';e={ (Get-QADObject $_).name }}
>>>
>>> GroupName Member
>>> --------- ------
>>> Group1 User1
>>> Group1 User1
>>> Group2 User2
>>> Group2 User2
>>> Group3 User3
>>> Group3 User3
>>> ---
>>> Shay Levy
>>> Windows PowerShell MVP
>>> http://blogs.microsoft.co.il/blogs/ScriptFanatic
>>> c> I'm having problems (most of which are being new to powershell!)
>>> in
>>> c> grabbing a list of all groups-users in a domain.
>>> c>
>>> c> I have played a bit w/ Quest's Active Directoy cmdlets and came
>>> up w/
>>> c> the
>>> c> following:
>>> c> get-qadgroup |
>>> c> foreach-object {get-qadgroupmember ($_)}
>>> c> This, techncially does what it is suppose to do.... For every
>>> group,
>>> c> it lists the members. But, the problem is, it doesn't state the
>>> c> group name!!
>>> c>
>>> c> I simple need to get a dump from AD off all group and
>>> memberships.
>>> c>
>>> c> Thanks!
>>> c>


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
list users, NOT members of a group PowerShell
Problem copying list of contacts into a new group list Vista mail
No users in Local Administrators Group Vista security
List all Group Users in AD PowerShell
list users in a local group on a distant computer PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46