Network Setting in a unattended install Windows 7
I am working on a unattended install for Windows 7 64 bit. I successfully installed Windows 7, grab the computer name then rename the computer, add it to the domain, and turn off the User Access Control. I am now working on network settings and some advanced network settings. I need to do the following:
1) Select the "Use the following DNS server addresses" button
2) Add a perferred DNS server and alternate DNS server
3) Append a DNS suffix with scc.county.zone
4) Add a DNS suffix for this connection (scc.county.zone)
5) Add two IP addresses in the WINS tab
Does anyone have a sample xml file or know how to do the above?
Kurt
1) Select the "Use the following DNS server addresses" button
2) Add a perferred DNS server and alternate DNS server
3) Append a DNS suffix with scc.county.zone
4) Add a DNS suffix for this connection (scc.county.zone)
5) Add two IP addresses in the WINS tab
Does anyone have a sample xml file or know how to do the above?
Kurt
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
kwoodfin
13 years ago
I never received a response on this post, and I was unable to figure out how to do this in the unattend.xml file. I wrote a script instead. If anyone is interested, here is what I came up with. I have no training in VB scripts, but it works.
Dim strWINSPrimaryServer, strWINSSecondaryServer
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
Set objNetworkSettings = objWMIService.Get("Win32_NetworkAdapterConfiguration")
strDNSServers = Array("1.2.3.4","5.6.7.8")
strDNSSuffixes = "yournetwork"
strWINSPrimaryServer = "1.2.3.4"
strWINSSecondaryServer = "5.6.7.8"
arrDNSSuffixes = Array("yournetwork")
For Each objNetAdapter in colNetAdapters
objNetAdapter.SetWINSServer strWINSPrimaryServer, strWINSSecondaryServer
objNetAdapter.SetDNSServerSearchOrder(strDNSServers)
objNetAdapter.SetDNSDomain(strDNSSuffix)
objNetworkSettings.SetDNSSuffixSearchOrder(arrDNSSuffixes)
' DNS suffix for this connection
intSetDomain = objNetAdapter.SetDNSDomain("yournetwork")
' Register this connections address in DNS, Use this connections DNS suffix in DNS registration
intDynReg = objNetAdapter.SetDynamicDNSRegistration (True, False)
Next
Dim strWINSPrimaryServer, strWINSSecondaryServer
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
Set objNetworkSettings = objWMIService.Get("Win32_NetworkAdapterConfiguration")
strDNSServers = Array("1.2.3.4","5.6.7.8")
strDNSSuffixes = "yournetwork"
strWINSPrimaryServer = "1.2.3.4"
strWINSSecondaryServer = "5.6.7.8"
arrDNSSuffixes = Array("yournetwork")
For Each objNetAdapter in colNetAdapters
objNetAdapter.SetWINSServer strWINSPrimaryServer, strWINSSecondaryServer
objNetAdapter.SetDNSServerSearchOrder(strDNSServers)
objNetAdapter.SetDNSDomain(strDNSSuffix)
objNetworkSettings.SetDNSSuffixSearchOrder(arrDNSSuffixes)
' DNS suffix for this connection
intSetDomain = objNetAdapter.SetDNSDomain("yournetwork")
' Register this connections address in DNS, Use this connections DNS suffix in DNS registration
intDynReg = objNetAdapter.SetDynamicDNSRegistration (True, False)
Next
Comments:
-
' Register this connections address in DNS, Use this connections DNS suffix in DNS registration
intDynReg = objNetAdapter.SetDynamicDNSRegistration (True, False)
Next
DNS and WINS vbs script is working in Win10,
But "tick" the option in "Use this connection DNS sufix in DNS registration" , it is not working in Win10, may i know how can i fix it , thanks a lot - Shenmue2 7 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.