How to Check Which Domain Controller I Am Using

  1. Home
  2. Windows
  3. General Windows

Hello, i have a question about finding out which domain controller im connected to.  I know 2 different commands.  1 being the echo %logonserver% command and the other being the nltest /dsgetdc<domainname> command.  When i run these, i get 2 different domain control results.  Is one of those commands for the computer profile and the other for the user profile?


Popular Topics in General Windows

The help desk software for IT. Free.

Track users' IT needs, easily, and with only the features you need.

17 Replies

jcLAMBERT
jcLAMBERT This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Jan 9, 2020 at 20:23 UTC

From file explorer, just type %logonserver%

momurda

cmd.exe > echo %logonserver%

or Install bginfo

Rod-IT
alex32165
alex32165 This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Jan 9, 2020 at 20:40 UTC

okay so im aware of the logonserver command, but i am trying to understand the difference between that and the  nltest /dsgetdc<domainname> command and why it gives a different result.

GuruGabe1
GuruGabe1 This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Jan 9, 2020 at 21:33 UTC

Would the nltest result be your PDC?

momurda

alex32165 wrote:

okay so im aware of the logonserver command, but i am trying to understand the difference between that and the  nltest /dsgetdc<domainname> command and why it gives a different result.

First glance it looks like /dsgetdc returns the pdc emulator, logonserver is the dc that youre current session auth with.

                                                        C                            :                            \                            Users                            \                            momurda                            >                            nltest                            /                            dsgetdc                            :                            domain                            .                            com                            DC                            :                            \\                            dc                            .                            domain                            .                            com                            Address                            :                            \\                            10                            .                            1                            .                            0                            .                            231                            Dom                            Guid                            :                            4c5457a2                            -                            4e82                            -                            4029                            -                            9d9d                            -                            7e2b2339e5bc                            Dom                            Name                            :                            domain                            .                            com                            Forest                            Name                            :                            domain                            .                            com                            Dc                            Site                            Name                            :                            Default                            -First-Site-Name                            Our                            Site                            Name                            :                            Default                            -First-Site-Name                            Flags                            :                            PDC                            GC                                                        DS                            LDAP                            KDC                            TIMESERV                            GTIMESERV                            WRITABLE                            DNS_DC                            DNS_DOMAIN                            DNS_FOREST                            CLOSE_SITE                            FULL_SECRET                            WS                            DS_8                            The                            command                            completed                            successfully                          
Fessor

Or from the command prompt C:\> set L

to get the logonserver

alex32165
alex32165 This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Jan 9, 2020 at 22:05 UTC

GuruGabe1 wrote:

Would the nltest result be your PDC?

No, the NLtest does not list my PDC.

bbigford
bbigford This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Jan 10, 2020 at 00:25 UTC

momurda wrote:

cmd.exe > echo %logonserver%

or Install bginfo

I use this one often.

Batman's Byte

I get the same thing, two different results (both DCs) from two different commands, but I don't know why either.

adrian_ych
adrian_ych This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Jan 10, 2020 at 04:53 UTC

What OS are your DCs ?

You may get different results as one is to check which DC is available and other is to check which DC is the machine logged to.

Then also depending on how the DNS settings are set in both DCs (round robin or not), it should not really matter which DC the machines are logged into as DCs are supposed to run as HA and FT (if there are 2 or more DCs properly set up).

Errtus

alex32165 wrote:

okay so im aware of the logonserver command, but i am trying to understand the difference between that and the  nltest /dsgetdc<domainname> command and why it gives a different result.

Well, the answer is that nltest doesn't return the domain controller you're logged into.

Rupesh (Lepide)
Rupesh (Lepide) This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Jan 10, 2020 at 09:41 UTC

Brand Representative for Lepide

You can run "echo %logonserver%" in a command line to view the current connected DC.

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>

Griff_389
Griff_389 This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Jan 10, 2020 at 11:45 UTC

I just use "set" from a command prompt and check the logonserver variable.

Or as pointed out previously, type "set L" to get just the variables beginning with L (or "set Log" to be more specific).

FelipePena

I've always used the Set command on local workstations.

On servers I like nltest /DSGETDC Lot;s more options available by typing nltest /? if you really need to figure things out.,

psctech911

SETcommand returns the value from the time that it was set, that is, it is not dynamic. So in the event of multiple domain controllers (and the chance you've failed over to a new one) it may mislead.

This topic has been locked by an administrator and is no longer open for commenting.

To continue this discussion, please ask a new question.

How to Check Which Domain Controller I Am Using

Source: https://community.spiceworks.com/topic/2251077-how-to-find-out-what-domain-controller-i-m-connected-to

0 Response to "How to Check Which Domain Controller I Am Using"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel