• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 533
  • Last Modified:

Display name of group member

Hi

output of code below:
CN=Goerge,OU=CALIFORNIA,DC=XXX,DC=com
CN=John,OU=NewYork,DC=XXX,DC=com
CN=James,OU=NewYork,DC=XXX,DC=com
CN=Michelle,OU=Tokyo,DC=XXX,DC=com
.
.
.
.

how  i can just display name of member :
Name:
+++++++
Goerge
John,
James
Michelle

thanks

$Root=([ADSI]"").DistinguishedName 
$Group=[ADSI]("LDAP://CN=Domain name, CN=Users," + $root) 
$Group.memeber

Open in new window

0
ang3lus
Asked:
ang3lus
  • 3
  • 3
  • 2
  • +1
2 Solutions
 
Shabarinath RamadasanInfrastructure ArchitectCommented:
I assme you just want the display name of members of a group.

I would use the below cmdlet from quest

Get-QADGroupmember -identity "GroupName" |Select-object displayname

Cheerio
Shaba
0
 
ang3lusAuthor Commented:
i've tried this before
for some reason the cmdlet Get-QADGroupmember doesnot work to me
i always got this error for command start with get-blabla
the term "Get-QADGroupmember" is not recognised as a name of cmdlet.

regards my question i wanna display the name for all groups members in domain not just for particular one

thanks
0
 
rlandquistCommented:
or samaccountname for username
0
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

 
ang3lusAuthor Commented:
can you clear that more ???? or samaccountname for username???
0
 
soostibiCommented:
To use QAD cmdlets, you have to isntall them by this:
http://www.quest.com/powershell/activeroles-server.aspx

And then in PowerShell run:

add-pssnapin Quest.ActiveRoles.ADManagement

before you run these cmdlets.
If you do not want to use Quest AD cmdlets, you can run this:
$Root=([ADSI]"").DistinguishedName   
$Group=[ADSI]("LDAP://CN=shadow-dom-r2-Kelet,OU=Kelet," + $root)   
$Group.member | %{
    ([ADSI]("LDAP://$_")).sAMAccountName
}

Open in new window

0
 
soostibiCommented:
Sorry, this is your code:
$Root=([ADSI]"").DistinguishedName   
$Group=[ADSI]("LDAP://CN=Domain name, CN=Users," + $root)   
$Group.memeber | %{
    ([ADSI]("LDAP://$_")).sAMAccountName
}

Open in new window

0
 
soostibiCommented:
Or with displayname:
$Root=([ADSI]"").DistinguishedName     
$Group=[ADSI]("LDAP://CN=Domain name, CN=Users," + $root)     
$Group.memeber | %{  
    ([ADSI]("LDAP://$_")).displayName
}

Open in new window

0
 
Shabarinath RamadasanInfrastructure ArchitectCommented:
you are getting this error because your computer dont have the quest AD roles installed.
Install it and see the magic.

Good luck
Shaba
0
 
rlandquistCommented:
Your comment: can you clear that more ???? or samaccountname for username???
I was commenting on the previous code suggested.

Sure, instead of:
Get-QADGroupmember -identity "GroupName" |Select-object displayname

to get username you can use this code
Get-QADGroupmember -identity "GroupName" |Select-object samaccountname

0
 
ang3lusAuthor Commented:
thanks gay
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now