Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Active Directory
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



How to extract only common names for members of a group

Active Directory


Reply
 
Thread Tools Search this Thread
  #1  
Old 26-02-2009
Ronnie
 
Posts: n/a
How to extract only common names for members of a group

Hi,

I've been trying to extract the usernames for member of a group using this:

DSGET GROUP "cn=HER-GBS-DAT-ADM,ou=security
groups,ou=groups,ou=locations,dc=domain name,dc=com" -members

However this extracts everything including OU and DC for each user. How can
I keep it down to just extracting the common name as this is all the info I'm
interested in?

Thanks,
Ronnie
Reply With Quote
  #2  
Old 26-02-2009
Ronnie
 
Posts: n/a
RE: How to extract only common names for members of a group

I was just thinking that it would actually be even better if I could get
just the usernames and not the common names. Is this possible?

Thanks in advance,
Ronnie
Reply With Quote
  #3  
Old 27-02-2009
bfoster68
 
Posts: n/a
RE: How to extract only common names for members of a group

If you want to do this in PowerShell you could do something like this. You
will need to install Quest Active Roles to get the QAD snapin

http://www.quest.com/powershell/activeroles-server.aspx



$UserObject=Get-QADUser -sizelimit 0

foreach ($SamName in $UserObject)
{
$SamName.samaccountname
}






"Ronnie" wrote:

>
>
> "Ronnie" wrote:
>
> > Hi,
> >
> > I've been trying to extract the usernames for member of a group using this:
> >
> > DSGET GROUP "cn=HER-GBS-DAT-ADM,ou=security
> > groups,ou=groups,ou=locations,dc=domain name,dc=com" -members
> >
> > However this extracts everything including OU and DC for each user. How can
> > I keep it down to just extracting the common name as this is all the info I'm
> > interested in?
> >
> > Thanks,
> > Ronnie

>
> I was just thinking that it would actually be even better if I could get
> just the usernames and not the common names. Is this possible?
>
> Thanks in advance,
> Ronnie

Reply With Quote
  #4  
Old 27-02-2009
Paul Bergson [MVP-DS]
 
Posts: n/a
Re: How to extract only common names for members of a group

How about running the following from a command prompt, replacing <group
name> with the group you are looking for info on
net group /domain <group name>

--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.


"Ronnie" <Ronnie@discussions.microsoft.com> wrote in message
news:F86E5082-1F2A-4E73-A1A0-138B00F708D4@microsoft.com...
> Hi,
>
> I've been trying to extract the usernames for member of a group using
> this:
>
> DSGET GROUP "cn=HER-GBS-DAT-ADM,ou=security
> groups,ou=groups,ou=locations,dc=domain name,dc=com" -members
>
> However this extracts everything including OU and DC for each user. How
> can
> I keep it down to just extracting the common name as this is all the info
> I'm
> interested in?
>
> Thanks,
> Ronnie


Reply With Quote
  #5  
Old 02-03-2009
Ronnie
 
Posts: n/a
Re: How to extract only common names for members of a group

Thanks, Paul. This does exactly what I weas looking for. Can I export the
results into a CSV file somehow?
Reply With Quote
  #6  
Old 02-03-2009
Paul Bergson [MVP-DS]
 
Posts: n/a
Re: How to extract only common names for members of a group

You could pipe it to a file > output.txt

But it won't be any different then what is on the screen

--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Reply With Quote
  #7  
Old 02-03-2009
Ronnie
 
Posts: n/a
Re: How to extract only common names for members of a group

Ok, I already piped it to txt files for each group, but was hoping that I
could get it out in another format. Anyway I'm now able to do what I wanted
so thanks again.

Regards,
Ronnie
Reply With Quote
  #8  
Old 05-03-2009
Paul Bergson [MVP-DS]
 
Posts: n/a
Re: How to extract only common names for members of a group

Glad to help

--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Active Directory


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to extract only common names for members of a group"
Thread Thread Starter Forum Replies Last Post
Listing members of Group with >1500 members Umesh Thakur Windows Server Help 11 1 Week Ago 05:29 AM
Display members of a group with more than 1500 members Simon G Windows Server Help 5 25-10-2011 01:35 PM
Using DSQUERY to get the members of a Group in AD Bob Randall Active Directory 9 11-11-2009 10:39 PM
Extract members and groups from AD Rondo Active Directory 8 16-01-2009 02:44 AM
List all the members of a group Jigjags Windows Server Help 1 14-02-2008 10:58 PM


All times are GMT +5.5. The time now is 07:54 PM.