List Your Domain Controller

Returns the name of the domain controller used to authenticate the logged-on user of a computer.

VBScript Code


Set objDomain = GetObject("LDAP://rootDse")

objDC = objDomain.Get("dnsHostName")
Wscript.Echo "Authenticating domain controller:" & objDC