Thursday, December 4, 2008

Identifying Your Domain Controller

Returns the name of the domain controller that was used to authenticate the current user of a computer.

Set objDomain = getObject("LDAP://rootDse")
objDC = objDomain.Get("dnsHostName")
Wscript.Echo objDC

This is a VB Script, this can be used by saving the file in .vbs file