Thread: Quest AD help
View Single Post
Old 09-11-2007   #10 (permalink)
Brandon Shell


 
 

Re: Quest AD help

$group is suppose to be the DN of group, not a OU/CN.

"Ian_1" <fakeaddy@xxxxxx> wrote in message
news:BE1AC77C-34D9-4EA9-92B0-5159F2624477@xxxxxx
Quote:

> Like I wrote Brandon, it does nothing, just goes from one line to the
> next:
>
> PS C:\scripts> C:\scripts\All_Test.ps1
> PS C:\scripts>
>
> #ALL Test
> $group = [ADSI]"LDAP://OU=USERS,DC=domain,DC=NET"
> #$group = [ADSI]"LDAP://CN=ALTX.Data.Maint,OU=Distribution
> Lists,OU=CH,DC=echristus,DC=NET"
> foreach($member in $group.member)
> {
> $user = [ADSI]"LDAP://$member"
> Write-Host ("First Name:{0}" -f ($user.givenName).ToString())
> Write-Host ("Last Name:{0}" -f ($user.sn).ToString())
> Write-Host ("Display Name:{0}" -f ($user.Displayname).ToString())
> Write-Host ("Email:{0}" -f ($user.mail).ToString())
> Write-Host
> }
My System SpecsSystem Spec