70

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

essential
  • 241
C. Ross
  • 6,734

6 Answers6

100

You can find this through the following command:

echo %LOGONSERVER%

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

set
Shadok
  • 4,070
53

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 /dclist:services.microsoft.com, 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%
3

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.

JoshP
  • 2,263
  • 3
  • 22
  • 28
Noel
  • 31
2

Powershell provides (with no parameters):

Get-ADDomainController

Or specifically:

(Get-ADDomainController).HostName
rupert160
  • 165
2

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...

Supercereal
  • 8,761
1

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

Erwin
  • 11