Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Active Directory > Using DSQUERY to get the members of a Group in AD

Reply
Thread Tools Display Modes

Using DSQUERY to get the members of a Group in AD

 
 
Bob Randall
Guest
Posts: n/a

 
      04-06-2005
Can anyone give the the correct syntax (if it exists) to use the DSQUERY
command line tool to query the members of a specific group in AD? I have
tried many combonations and I cant seem to figure it out. I tried:

dsquery user OU=xxx, DC=yyy,DC=ZZZ

but I don't know what should go after that. I also tried the dsquery group
method with no luck. Does anyone know the correct way??

Thanks!

Bob Randall

 
Reply With Quote
 
 
 
 
ptwilliams
Guest
Posts: n/a

 
      04-06-2005
C:\>dsget group "CN=GroupName,DC=domain-name,DC=com" -members

If you need to specify a server and/ or credentials, append the following on
the end:

-s dc01 -u userName -p *


--
Paul Williams

http://www.msresource.net/
http://forums.msresource.net/

 
Reply With Quote
 
Bob Randall
Guest
Posts: n/a

 
      04-06-2005
Perfect - thanks a lot!

"ptwilliams" wrote:

> C:\>dsget group "CN=GroupName,DC=domain-name,DC=com" -members
>
> If you need to specify a server and/ or credentials, append the following on
> the end:
>
> -s dc01 -u userName -p *
>
>
> --
> Paul Williams
>
> http://www.msresource.net/
> http://forums.msresource.net/
>

 
Reply With Quote
 
ptwilliams
Guest
Posts: n/a

 
      04-06-2005
No problem! :-)

--
Paul Williams

http://www.msresource.net/
http://forums.msresource.net/


 
Reply With Quote
 
Mik
Guest
Posts: n/a

 
      02-06-2006
I am trying the same thing but I keep getting this error:

dsget failed:A referral was returned from the server.

Any ideas what this is?

"ptwilliams" wrote:

> No problem! :-)
>
> --
> Paul Williams
>
> http://www.msresource.net/
> http://forums.msresource.net/
>
>
>

 
Reply With Quote
 
Paul Williams [MVP]
Guest
Posts: n/a

 
      02-07-2006
What command are you typing?

--
Paul Williams
Microsoft MVP - Windows Server - Directory Services
http://www.msresource.net | http://forums.msresource.net


 
Reply With Quote
 
Mik
Guest
Posts: n/a

 
      02-07-2006
dsget group "CN=Group,CN=users,DC=domain,DC=ca" -members

"Paul Williams [MVP]" wrote:

> What command are you typing?
>
> --
> Paul Williams
> Microsoft MVP - Windows Server - Directory Services
> http://www.msresource.net | http://forums.msresource.net
>
>
>

 
Reply With Quote
 
Mik
Guest
Posts: n/a

 
      02-08-2006
We are running AD (2003) in native mode and Exchange 2003 in mixed mode with
2 Exch 5.5 servers. It is a simple single domain forest with about 2000
users.

Not sure what else may help?

Thanks,

Mike

"Paul Williams [MVP]" wrote:

> I don't understand that. DSGET will chase referrals. I just used that same
> command to output the members of a group in the root domain from a child
> domain.
>
> What else can you tell me about your environment?
>
> --
> Paul Williams
> Microsoft MVP - Windows Server - Directory Services
> http://www.msresource.net | http://forums.msresource.net
>
>
>

 
Reply With Quote
 
Paul Williams [MVP]
Guest
Posts: n/a

 
      02-10-2006
Weird. I can't see why that command won't work. Unless the domain you are
using is different to your DNS domain?

Try the same thing with adfind (download from www.joeware.net)

adfind -b cn=group,cn=users,dc=domain-name,dc=com member -nodn

--
Paul Williams
Microsoft MVP - Windows Server - Directory Services
http://www.msresource.net | http://forums.msresource.net


 
Reply With Quote
 
DA
Guest
Posts: n/a

 
      06-22-2006
I get that with scripts that enumerate object in AD when I run the script
logged on to a domain different from that I'm trying to search. Try it first
making sure you're logged on to the domain you're searching and you might
have it work doing the command as a batch file and doing "run as" and
specifying creds in the search domain.

"Paul Williams [MVP]" wrote:

> Weird. I can't see why that command won't work. Unless the domain you are
> using is different to your DNS domain?
>
> Try the same thing with adfind (download from www.joeware.net)
>
> adfind -b cn=group,cn=users,dc=domain-name,dc=com member -nodn
>
> --
> Paul Williams
> Microsoft MVP - Windows Server - Directory Services
> http://www.msresource.net | http://forums.msresource.net
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dsquery to list members of group joey Windows Server 1 11-05-2008 02:13 AM
Can't select members for group JB Windows Vista Mail 2 06-12-2007 10:36 PM
RE: View group members Crina Li Windows Small Business Server 0 03-23-2006 07:45 AM
Re: View group members Owen Williams Windows Small Business Server 0 03-22-2006 09:56 PM
Printing Group Members Dave Active Directory 5 06-16-2004 01:39 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59