_PDC — Returns the name of the primary domain controller.

Syntax:
%_PDC

The returned name will begin with a double backslash. On any error, or if the computer is not joined to a domain, this variable will return an empty string.


echo %_pdc