How to point a client to different domain controller

Here is a useful command that I’ve discovered.
Imagine a situation where you have a domain called domain.local with multiple domain controllers DC0, DC1 etc.
For some reason some clients are not working as expected or working slower. In my case it was when I tried to run gpresult /r on some clients it was taking ages to provide full details. To find out if any of the domain controllers is having problems I wanted quickly to change the domain controller that the affected client is using.
Back in the day when Windows NT 4 ruled the world there was a command called setprfdc (set preferred domain controller) nltest does something similar.

So first I wanted to find out what DC the client is using. Now there are many different ways but here is a command that I’ve used:
nltest /dsgetdc:domain.local

The output was:

DC: \DC0.DOMAIN.local
Address: \10.10.10.1
Dom Guid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Dom Name: DOMAIN.local
Forest Name: DOMAIN.local
Dc Site Name: Default-First-Site-Name
Our Site Name: Interxion
Flags: PDC GC DS LDAP KDC TIMESERV WRITABLE DNS_DC DNS_DOMAIN DNS_FOREST
The command completed successfully

This means that the client is using DC0. Now I wanted quickly to point the client to a diferent domain controller DC1. To do that write the following command:

nltest /Server:client0 /SC_RESET:domain.localdc1

The output should be:

Flags: 30 HAS_IPĀ  HAS_TIMESERV
Trusted DC Name \DC1.DOMAIN.local
Trusted DC Connection Status Status = 0 0x0 NERR_Success
The command completed successfully

If you run the first command again you should see that domain controller has changed.
This is a temporary thing as after some time the cleint will fallback to the original domain controller.

Leave a Reply

Your email address will not be published.