Jump to content

Registry Key Script


Recommended Posts

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. :huh:

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. :wacko:

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 Next

Dim nicGUID

Dim WshShell

strComputer = "."

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 if

Next

Set 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


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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...