dsquery

i have two differtent  domain let say abc.com and other is edf.com.

now on abc domain

I want search computer if it is in domain or not using dsquery

when i run the command

dsquery computer domaninroot -name corporate01

the output comes

but problem happens when I search some computers in edf domain from the same server



what is the exact dsquery command to run

September 2nd, 2015 3:21pm

Try with -d edf.com. By default the tool use the %logonserver%, thus the domain you are logged on with your user account.

{-s <Server> | -d <Domain>}

Connects a computer to a remote server or domain that you specify. By default, dsquery connects the computer to the domain controller in the logon domain.

Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2015 9:32pm

You have specified "domainroot" in your command, which will force your search starts at your current domain root. Probably, try to use "forestroot" instead, dsquery search will use the global catalog then.
 
Or as Philippe suggested above, use -d parameter to connect to a different domain.
 
Here is the article you might need:
 
https://technet.microsoft.com/en-us/library/cc730720.aspx
 

Regards,

Eth

September 3rd, 2015 12:11am

Thanks you Ethan
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 10:25am

Thank you Yagmoth it worked.
September 3rd, 2015 10:25am

Hi Ethan/Yagmoth

Can any of help me with more thing

I am trying to search domain and sub-domain using the below command but not getting the result

dsquery computer -d edf.com -scope subtree -name

But not getting the output

the sub domains are

america.edf.com

europe.edf.com

edfcorp.edf.com

My local domain is edfcorp.edf.com from where i am searching

please tell me where i am wrong

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 3:02pm

In order to avoid confusion and keep track of troubleshooting steps, we usually troubleshoot one issue per thread in order to find a resolution efficiently. So I'd suggest we create a new post.
 

Regards,

Eth

September 6th, 2015 11:08pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics