Currently, we have an environment that requires adding a new Domain Controller with a new IP Address. Management requires all the servers in the environment to update the DNS with a new IP Address of the Domain controller.
There are multiple servers with either single or multiple nik cards. Also, there are multiple cluster servers configured with two or three network cards.
The netsh command can work but the interface name is not consistent. Also, some network cards do not need to be updated with the DNS server IP Address.
netsh interface ipv4 add dnsservername="Local Area Connection" address=192.168.100.48 index=2
Is there a script to query the network cards of each server to identify the interface name as a variable and use it to update the DNS IP Address? Also, if the DNS IP Address is not configured, the command will skip updating the setting. Finally, it would provide a report to determine which of the servers have been updated with the latest configuration.