?
Solved

Display name of group member

Posted on 2011-05-04
10
Medium Priority
?
531 Views
Last Modified: 2012-05-11
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
Comment
Question by:ang3lus
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 14

Accepted Solution

by:
Shabarinath Ramadasan earned 1000 total points
ID: 35692996
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
 

Author Comment

by:ang3lus
ID: 35693110
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
 
LVL 12

Expert Comment

by:rlandquist
ID: 35693132
or samaccountname for username
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:ang3lus
ID: 35693233
can you clear that more ???? or samaccountname for username???
0
 
LVL 13

Assisted Solution

by:soostibi
soostibi earned 1000 total points
ID: 35693235
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
 
LVL 13

Expert Comment

by:soostibi
ID: 35693251
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
 
LVL 13

Expert Comment

by:soostibi
ID: 35693287
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
 
LVL 14

Expert Comment

by:Shabarinath Ramadasan
ID: 35693291
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
 
LVL 12

Expert Comment

by:rlandquist
ID: 35693517
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
 

Author Closing Comment

by:ang3lus
ID: 35693669
thanks gay
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Loops Section Overview
Screencast - Getting to Know the Pipeline

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question