_DOMAINDNS — Returns the domain’s DNS name.

Syntax:
%_DOMAINDNS

If the computer is not joined to a domain, this variable returns an empty string.


iff "%_domaindns" != "" then
   echo %computername is a member of %_domaindns
else
   echo %computername is not a member of a domain.
endiff