Forum Search:
Forum.Brain-Cluster.com: Brain Cluster Technical Forum
Ultimate forum for Technical Discussions

Home » Microsoft » Windows Server » Active Directory » DSQuery Help!
DSQuery Help! [message #384276] Thu, 04 February 2010 11:05 Go to next message
nik  is currently offline nik  Canada
Messages: 115
Registered: September 2009
Senior Member
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
Thanks
Nik
Re: DSQuery Help! [message #384313 is a reply to message #384276] Thu, 04 February 2010 11:50 Go to previous messageGo to next message
nik  is currently offline nik  Canada
Messages: 115
Registered: September 2009
Senior Member
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



"Nik" <nalleyne@maxxam.lab> wrote in message
news:OkKVxRcpKHA.1548@TK2MSFTNGP04.phx.gbl...
> 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
> Thanks
> Nik
RE: DSQuery Help! [message #384472 is a reply to message #384276] Thu, 04 February 2010 14:56 Go to previous messageGo to next message
tkutil  is currently offline tkutil
Messages: 54
Registered: July 2009
Member
Here is how I do it. My group name is engineering.

dsquery group -name engineering|dsget group -members|dsget user -samid -fn -ln

"Nik" wrote:

> 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
> Thanks
> Nik
>
> .
>
RE: DSQuery Help! [message #384971 is a reply to message #384276] Fri, 05 February 2010 08:06 Go to previous messageGo to next message
Eric Westfall  is currently offline Eric Westfall
Messages: 6
Registered: December 2009
Junior Member
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!

"Nik" wrote:

> 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
> Thanks
> Nik
>
> .
>
Re: DSQuery Help! [message #385154 is a reply to message #384971] Fri, 05 February 2010 12:43 Go to previous message
nik  is currently offline nik  Canada
Messages: 115
Registered: September 2009
Senior Member
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
Thanks for the help guys

"Eric Westfall" <EricWestfall@discussions.microsoft.com> wrote in message
news:EABC6895-C63D-4C23-8AEB-215EB26EF07E@microsoft.com...
> 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!
>
> "Nik" wrote:
>
>> 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
>> Thanks
>> Nik
>>
>> .
>>
Previous Topic:Curious "Access Is Denied" Error When Synchronising Offline Folders
Next Topic:Windows 2003 Forest - PDC Emulator
Goto Forum:
  


Current Time: Tue Jan 23 16:36:31 MST 2018

Total time taken to generate the page: 0.27447 seconds
.:: Contact :: Home ::Sitemap::.

Powered by: FUDforum 3.0.0RC2.
Copyright ©2001-2009 FUDforum Bulletin Board Software