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 Tutorial - Trying to get nested users from Distribution Lists in AD

Reply
 
Old 06-17-2008   #1 (permalink)
kirgan.peacock
Guest


 
 

Trying to get nested users from Distribution Lists in AD

I am new to Powershell, but have been a Perl dev for many years. So,
I'm familiar with what you can do with a script... I just don't know
how to do it in Powershell. =)

I've been tasked with providing a list of users that are part of the
given distribution list. Here are my constraints:

1. This needs to be with Powershell as it's installed - no additional
cmdlets (so I can't use Get-QADGroupMember)
2. I don't know how many DLs will be nested.

I've tried searching around online, but everyone is using the cmdlet
mentioned above, or the Exchange cmdlets. Since I don't have access
to either, can this be done?

Thanks!

--Lareth

My System SpecsSystem Spec
Old 06-17-2008   #2 (permalink)
Brandon [MVP]
Guest


 
 

Re: Trying to get nested users from Distribution Lists in AD

2000 or 2003?

If it is 2000 then your going to have to do the nested check yourself. If
2003 you can probably use ASQ.

General Good Doc for Searches
http://technet2.microsoft.com/Window...6ded41033.mspx

Also, I have a blog series on LDAP filters
http://bsonposh.com/archives/tag/LDAP-Filter
and
http://bsonposh.com/archives/tag/LDAP

<kirgan.peacock@xxxxxx> wrote in message
news:78328b70-d483-4f19-a312-e3f67075f5d5@xxxxxx
Quote:

>I am new to Powershell, but have been a Perl dev for many years. So,
> I'm familiar with what you can do with a script... I just don't know
> how to do it in Powershell. =)
>
> I've been tasked with providing a list of users that are part of the
> given distribution list. Here are my constraints:
>
> 1. This needs to be with Powershell as it's installed - no additional
> cmdlets (so I can't use Get-QADGroupMember)
> 2. I don't know how many DLs will be nested.
>
> I've tried searching around online, but everyone is using the cmdlet
> mentioned above, or the Exchange cmdlets. Since I don't have access
> to either, can this be done?
>
> Thanks!
>
> --Lareth
My System SpecsSystem Spec
Old 06-18-2008   #3 (permalink)
Shay Levi
Guest


 
 

Re: Trying to get nested users from Distribution Lists in AD



Try this too:

http://posh.jaykul.com/p/1156



---
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> I am new to Powershell, but have been a Perl dev for many years. So,
> I'm familiar with what you can do with a script... I just don't know
> how to do it in Powershell. =)
>
> I've been tasked with providing a list of users that are part of the
> given distribution list. Here are my constraints:
>
> 1. This needs to be with Powershell as it's installed - no additional
> cmdlets (so I can't use Get-QADGroupMember)
> 2. I don't know how many DLs will be nested.
> I've tried searching around online, but everyone is using the cmdlet
> mentioned above, or the Exchange cmdlets. Since I don't have access
> to either, can this be done?
>
> Thanks!
>
> --Lareth
>

My System SpecsSystem Spec
Old 06-18-2008   #4 (permalink)
Kirgan
Guest


 
 

Re: Trying to get nested users from Distribution Lists in AD

We have 2003. Thank you - this returns all the nested users! I
appreciate it very much! =)

--Kirgan
My System SpecsSystem Spec
Old 06-18-2008   #5 (permalink)
Brandon Shell [MVP]
Guest


 
 

Re: Trying to get nested users from Distribution Lists in AD

If your at Win2k3 SP2, A more efficient way is to use the LDAP_MATCHING_RULE_IN_CHAIN
defined here http://msdn.microsoft.com/en-us/library/aa746475.aspx

$dn = "<groupdn>"
$filter = "(memberof:1.2.840.113556.1.4.1941:=$dn)"
$ds = new-object System.DirectoryServices.DirectorySearcher([ADSI]"",$filter)
$ds.PageSize = 1000
$ds.FindAll()

Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject

K> We have 2003. Thank you - this returns all the nested users! I
K> appreciate it very much! =)
K>
K> --Kirgan
K>


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Help - Email Addresses in Distribution Lists Messed Up Vista mail
Distribution Lists in Windows Mail Vista mail
Distribution Lists Vista mail
Windows mail: Distribution Lists Vista mail
Distribution lists/group lists 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