I would like to write script to allow a workstation to join a domain. I have the IP address of the primary DC of this domain. Are there any commands / scripts that I can use to retrieve the domain name of this AD domain such that the domain name can be retrieved for the join domain operation?
All workstations / DCs are Windows Server 2008.
There are two NICs on the workstations / DCs. One of them is used for network load balancing (NLB) and the other is used for management. The default gateway is only set on the NIC for NLB while the IP Address I have is the management one. No reverse DNS zones were setup in the primary DC and changing the settings of it is not preferred.