Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I am using function NetGetDCName, but this seems to fail (err 2453) on a production Active directory

I used nltest.exe to test

Output of nltest /DCNAME:dir
Status = 2453 0x995 NERR_DCNotFound

However nltest/DCLIST:dir seems to list all the domain controller including the PDC.

How does nltest/DCLIST work ? I guess nltest /DCNAME:dir is using NetGetDCName only and fails with same error as my code.

I also did a nslookup on the host where I am getting error. I see that the DNS that it is pointing to is not one of the domain controller host.

Any tips on how should I get the PDC programatically?

share|improve this question
By PDC, do you mean the PDC Emulator role or, possibly, looking to figure out which DC is Global Catalog master/replica? And which versions of Windows? 2003, 2008, 2008R2??? On the command line, you can dump the roles with: netdom query /domain:<your NB domain name> fsmo – Kilo Aug 26 '10 at 10:54
There is no PDC in an AD domain, it is a multi master environment. Do you want the name of the server that holds the PDC emulator role? – Sam Aug 26 '10 at 10:58
PDC is primary domain controller – user52014 Aug 26 '10 at 11:36
@user52014: Yes, that is what the acronym means. In AD, however, the PDC role is merely an emulated role that any DC can perform. It is largely for backward compatibility with NT4 domains. Please see this technet for more details about roles in AD. – jscott Aug 26 '10 at 12:15
I suppose if your AD is running on NT4, PCD may be the correct terminology. – Kara Marfia Aug 26 '10 at 13:09

dsquery server -hasfsmo pdc

will return the FQDN of the domain controller who is holding the PDC Emulator role.

share|improve this answer

I didn't know this tool ;-), but it works in a 2003 domain:

Z:\bin>nltest /dcname:domain
PDC for Domain domain is \\server
The command completed successfully
share|improve this answer
PDC is primary domain controller – user52014 Aug 26 '10 at 11:35
I know, so? What I meant was that using the tool like that it works. I just masked the real domain name and server name – natxo asenjo Aug 26 '10 at 11:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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