_PDC — Returns the name of the primary domain controller.
_PDC
Syntax: %_PDC
%_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