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 - How to create a list with all distrubtion groups and it's members

Reply
 
Old 08-10-2008   #1 (permalink)
Dominik


 
 

How to create a list with all distrubtion groups and it's members

Hello everyone,
I want to create a single list, which contains all distribution groups and
it's members. The fields should be like this:
Groupname,Organizationalunit of Group,Username

Thanks in advance

My System SpecsSystem Spec
Old 08-11-2008   #2 (permalink)
Shay Levy [MVP]


 
 

Re: How to create a list with all distrubtion groups and it's members

Hello Dominik,


If you have Quest AD cmdlets (http://www.quest.com/activeroles-server/arms.aspx)
then you can try this (one-liner):


Get-QADGroup -GroupType distribution -sizeLimit 0 -ldap '(member=*)' | select
@{n="GroupName";e={$_.name}},@{n="GroupOU";e={(Get-QADGroup $_.Name).canonicalName}}
-expand members | select @{n="UserName";e={ (Get-QADObject $_).samAccountName}},GroupName,GroupOU




UserName GroupName GroupOU
-------- --------- -------
User1 DG1 Domain/Users
User2 DG1 Domain/Users
User3 DG1 Domain/Users
User1 DG2 Domain/Users/DGOU
User2 DG2 Domain/Users/DGOU
User3 DG2 Domain/Users/DGOU
User1 DG3 Domain/Users/SomeOU
User2 DG3 Domain/Users/SomeOU
User3 DG3 Domain/Users/SomeOU





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

D> Hello everyone,
D> I want to create a single list, which contains all distribution
D> groups and
D> it's members. The fields should be like this:
D> Groupname,Organizationalunit of Group,Username
D> Thanks in advance
D>


My System SpecsSystem Spec
Old 08-11-2008   #3 (permalink)
Dominik


 
 

Re: How to create a list with all distrubtion groups and it's memb

Dear Shay,

"Shay Levy [MVP]" wrote:
Quote:

> Hello Dominik,
>
>
> If you have Quest AD cmdlets (http://www.quest.com/activeroles-server/arms.aspx)
> then you can try this (one-liner):
>
>
> Get-QADGroup -GroupType distribution -sizeLimit 0 -ldap '(member=*)' | select
> @{n="GroupName";e={$_.name}},@{n="GroupOU";e={(Get-QADGroup $_.Name).canonicalName}}
> -expand members | select @{n="UserName";e={ (Get-QADObject $_).samAccountName}},GroupName,GroupOU
This really looks good, thank you! Is there a way, to limit the results only
to e-Mail activated groups?

Thanks and best Regards
Dominik
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Finding members of RDP groups of a list of computers VB Script
retrive all AD groups and its members VB Script
Exporting full list of members of a group (including groups andexternal accounts), but filtered and sorted VB Script
VBS reading all groups from OU and there members VB Script
Cannot create contact groups (mailing lists)-cannot add contact to list Vista mail


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