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



DSQuery Help!

Active Directory


Reply
 
Thread Tools Search this Thread
  #1  
Old 04-02-2010
Nik
 
Posts: n/a
DSQuery Help!

This is my syntax. I'm trying to read all members of a group.
dsquery * dc=mydomain,dc=lab -filter
"(&(objectCategory=group)(name=myGroup))" -attr displayName member
With this I have managed to read the groups but it brings the results out in
its fully distinguished Name. Is there a way I can probably just get the
name to display similar to if I had done for example
dsquery user -name Nik* -o rdn
Reply With Quote
  #2  
Old 05-02-2010
Nik
 
Posts: n/a
Re: DSQuery Help!

Sorry about that
dsquery * dc=mydomain,dc=lab -filter
(&(objectCategory=group)(name=*))" -attr displayName member
I wish for the members display name to show just as the groups display names
are show instead of the DN
Reply With Quote
  #3  
Old 05-02-2010
tkutil
 
Posts: n/a
RE: DSQuery Help!

Here is how I do it. My group name is engineering.

dsquery group -name engineering|dsget group -members|dsget user -samid -fn -ln
Reply With Quote
  #4  
Old 05-02-2010
Eric Westfall
 
Posts: n/a
RE: DSQuery Help!

The objectClass group stores membership under a mutli-value attribute called
member, which is stored as the distinguished name of the user account or
group.

A query of all available attributes shows that the sAMAccountName or display
name is not being stored as an attribute within the group objectClass. So
there would not be a single query filter that could be issued against the
group objectClass to get this information.

dsquery * dc=mydomain,dc=lab -filter "(&(objectCategory=group)(name=Domain
Admins))" -attr *

tkutil's way is a good method of getting the information though!
Reply With Quote
  #5  
Old 06-02-2010
Nik
 
Posts: n/a
Re: DSQuery Help!

Eric: thanks for clearing the air on that one at least I have a better
understanding of the query now.
Tkutil: I have used your method before to get the information when I
explicitly specify the group name
Reply With Quote
  #6  
Old 06-08-2010
Member
 
Join Date: Aug 2010
Posts: 1
Re: DSQuery Help!

try it the other way round

dsquery * -filter "(&(objectcategory=user)(memberof=""<thedistinguishednameofyourgroup>""))" -attr samaccountname display...etc... other attributes u might want to know about your users....
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: "DSQuery Help!"
Thread Thread Starter Forum Replies Last Post
Dsquery klatif Active Directory 1 06-10-2011 01:00 PM
using Dsquery and DSGET etechelp Active Directory 1 21-07-2011 12:32 AM
dsquery Matt Active Directory 7 18-11-2009 02:21 AM
Dsquery Dylan Active Directory 2 06-05-2009 09:17 PM
DSQUERY =?Utf-8?B?eWJtY3NlQG5ld3MucG9zdGFsaWFz?= Active Directory 4 26-01-2005 06:57 AM


All times are GMT +5.5. The time now is 01:49 AM.