Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I tell which Domain controller I'm authenticated to? Is there a way to do this without local admin?

share|improve this question
up vote 64 down vote accepted

You can find this through the following command:


And you don't have to be admin or poweruser to use it. Have a look at the output of this command:

share|improve this answer
FYI: Powershell didn't seem to have that variable set. I had to run it from basic command shell. – Christian Bongiorno Jul 1 '15 at 21:42
This doesn't work when you're logged on as a local user and you're interested in how the computer is authenticated to the domain. For that, see the other answer referencing nltest. – wfaulk Apr 1 at 19:47
A note, here you get your logged in users controller. Not the domain controller of the computer. – leiflundgren Jun 9 at 9:22

To determine computer / server DC use NLTEST:

nltest /dsgetdc:<domain_name> 

To list all DC's with their appropriate site, try:

nltest /dclist:<domain_name>

You don't have to use the FQDN of the domain name or server -- for example, instead of saying /, you can simply type /dclist:services (as long as you are an authenticated member of that domain, of course).

For user authentication and group policy use LOGONSERVER variable:

echo %logonserver%
share|improve this answer
nltest was much more reliable for me because LOGONSERVER did not work when coming by RDP – ZoolWay Nov 26 '15 at 9:39

set l will respond with the variables for both localappdata and for logonserver. However, logonserver is the only variable you are interested in, and the one which will tell you the name of the domain controller you authenticated against.

To only get the logonserver information, type set log (which is simply an abbreviation of set logonserver). The name of the domain controller you authenticated against will be returned.

share|improve this answer

This only answers your question if you have Outlook:

I found an interesting feature in Outlook. If you hold Ctrl and right click the icon in the task bar then click connection status it shows you the exchange server your connected to as well as what domain controller you are connected to. I actually found that one answering another question about Exchange connections, great way to recycle answers...

share|improve this answer
Where I got this info:… – Not Kyle stop stalking me Sep 9 '11 at 14:24
This is NOT entirely correct. In the rare situation where you have 2 DC's on site for DIFFERENT domains which both belong to the same forest and which both carry the Directory services, it is possible that you authenticate to your own domains DC while Outlook uses the other DC for the directory services. I have seen this happen. Caused a lot of grief, because adding delegates in Outlook doesn't work properly if your logon DC and the directory server used by Outlook are not in the same domain. – Tonny Aug 26 '13 at 10:16
I agree that this is less than reliable for the OP's question, but it is still useful info. Thanks! – jpaugh Apr 6 at 15:38

set L lists all environment variables that begin with the letter L

share|improve this answer
Mind explaining what this does? – soandos Jul 15 '12 at 18:18
Seems like it lists all variables starting with the letter L. Try set a for example. – Peter Jaric Nov 22 '12 at 18:30

protected by studiohack Nov 12 '14 at 21:57

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.