jcminjapan Posted October 14, 2004 Share Posted October 14, 2004 I am working on a system that has 700 users. They do not have active directory installed. I am moving them over to a new DNS Server and preparing them for moving over to active directory, but they do not want to do it all at one time. But, they want the new DNS server now. Well, here is my problem. I need to change 700 TCP/IP Settings. Now, making a logon script is a simple solution. Here is what I have so far: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\]"UseDomainNameDevolution"="1" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{02B38387-74B8-46DB-9ACC-550B7350574A}] "RegistrationEnabled"="1"Now, the top one is standard and I would be able to push that to any client that logs onto the NT Server Domain Controller. But, the 2nd one is causing a problem. The highlighted area is different on every machine. Does anyone know of a way to search the registry key and then change it?Thanks for any help. I would not look forward to doing this manually. Update..... I was actually able to figure it out. This only has the second in it right now. But, if anyone needs to looks for a key that is not a stable name, then this will help. I hope it helps someone.On Error Resume NextDim nicGUIDDim WshShellstrComputer = "."Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Set colItems = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration")For Each objItem in colItems if objItem.Index = 1 then' Wscript.Echo "Setting ID: " & objItem.SettingID nicGUID = objItem.SettingID Else End ifNextSet WshShell = WScript.CreateObject("WScript.Shell")WshShell.Run "reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\" & nicGUID & " /v RegistrationEnabled /t REG_DWORD /d 0 /f"Wscript.echo "All is updated" Link to comment Share on other sites More sharing options...
kenedy Posted October 14, 2004 Share Posted October 14, 2004 You can use AutoIt function "RegEnumKey" to retrieve key names and "RegWrite" to change DNS.netsh command may be able to do it too. Link to comment Share on other sites More sharing options...
Yzöwl Posted October 14, 2004 Share Posted October 14, 2004 Please note from bottom line of code it should say REG_SZ not REG_DWORD Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now