Using DSQUERY to get the members of a Group in AD
I need to query members of Specific group in Active Directory and I need to do it using SQUERY command line tool. As I’m not so good in SQUERY can anyone please provide me correct syntax to use the same? Let me tell you that I have already tried few combinations such as “dsquery user OU=xxx, DC=yyy,DC=ZZZ” but none of them worked so far for me.
Somebody also suggested me to run dsquery group method, I ran but that too dint helped. So I need help from you all.
RE: Using DSQUERY to get the members of a Group in AD
Here is the proper way of doing the same.
Quote:
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 like this:
-s dc01 -u userName -p *
Re: Using DSQUERY to get the members of a Group in AD
Hey, i think there is something wrong with me. I'm running the same command as you suggested but it ends up saying
Quote:
dsget failed:A referral was returned from the server.
Any ideas what this is?
Re: Using DSQUERY to get the members of a Group in AD
Are you sure you ran the correct command because the one mentioned above seems perfect to me as well. I am not getting why it is not working for you. Are you sure your domain is different to your DNS domain?
Try the same thing with adfind
adfind -b cn=group,cn=users,dc=domain-name,dc=com member -nodn
Re: Using DSQUERY to get the members of a Group in AD
Hi Paul,
Sorry, Can you help me to give a dsquery command to get all inactive domain clients from specific OU?
Thanks,
Nap