/build/static/layout/Breadcrumb_cap_w.png
05/22/2019 190 views

I am currently running 2 post installation tasks on my one of my images. We use KACE to image both school and town side, which are different domains. To connect to the town side, I need to hard code DNS into the system then connect to it. I have found a script that allows me to set DNS, and then join the domain. However, I need to switch the DNS back to automatic after it has been added to the domain, is there a way to do this? Is there a way to have the system go back and click the automatic radio button in iPv4 properties? I am still new and learning how to use all of this effectively, thanks for any feed back you can provide.

0 Comments   [ + ] Show comments

Comments



Community Chosen Answer

2

Keep it simple

Create a GPO to set the DNS when they join the domain.

Answered 05/23/2019 by: SMal.tmcc
Red Belt

All Answers

-2

Down there is a Powershell Script designed to switch back the DNS to automatic.

https://devblogs.microsoft.com/scripting/weekend-scripter-modify-dns-settings-via-windows-powershell/

The problem is you are going to need to know the name of the network adapter you want to modify.

The KACE SDA is able to run Powershell scripts as post install tasks.

I will add it here in case that page goes down someday, but all credits to them
This script will set the DNS setting to automatic for the network adapter. If you want... after running the command, run Get-DnsClientServerAddress to confirm the change to the DNS servers. When the DNS setting is set to automatic, the ServerAddress column is blank for the adapter.

Set-DnsClientServerAddress -InterfaceAlias wi-fi -ResetServerAddresses
Answered 05/22/2019 by: Channeler
Red Belt