This is driving me insane, if anyone has access to an XP machine can they please see if this works for them. I am running this with local admin.
You can enter whatever entries you wish.
What I dont understand is that I can manually enter the entries without a problem but I can't add them through a script.
code:
$NicKey = EnumKey ("HKLM\Software\Microsoft\Windows NT\CurrentVersion\NetworkCards",0)
$NicCrd = ReadValue ("HKLM\Software\Microsoft\Windows NT\CurrentVersion\NetworkCards\"+$NicKey,"ServiceName")
WriteValue ("HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\"+$NicCrd,"Domain","yourdomain.com","REG_SZ")
WriteValue ("HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\"+$NicCrd,"NameServer","192.168.10.1","REG_SZ")
WriteValue ("HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\"+$NicCrd,"RegistrationEnabled","1","REG_DWORD")
WriteValue ("HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\"+$NicCrd,"RegisterAdapterName","1","REG_DWORD")
WriteValue ("HKLM\System\CurrentControlSet\Services\Tcpip\Parameters","SearchList","yourdomain.com","REG_SZ")
The result should be that yourdomain.com will appear as a DNS suffix and the ip address 192.168.10.1 will appear in the DNS server addresses. The two checkboxes down the bottom of the advanced TCP/IP settings should also be checked.
Grasshopper75