Using ZEN to convert from Static IP to DHCP
Novell Cool Solutions: Trench
By Gary Pinder
Digg This -
Slashdot This
Posted: 25 Jan 2000 |
Current Version: ZENworks 2
A little while back you posted a "From the Trenches article" entitled "Convert Win95 machines from Static IP to DHCP". Jonathan F. indicated that you could not use ZEN alone to perform this task.
I have discovered a way to do it. Following you will find the contents of an AXT file that we use here at the Federal Court of Canada to change workstation IP information. This is required at times as a computer may go out from our principal office to a regional office with the wrong network information. To have this application change a computer from Static IP to DHCP you would need only set the IP_Address and SubNet_Mask macros to 0.0.0.0 and remove the references to the Default_Gateway macro.
Here's a zip file containing the AXT.
More Ideas
Dan Poulsen
Here's an addition for your 'From the trenches' on converting workstations to DHCP. This VBS script will work on Win95/98 workstations. You must install the Windows Scripting Host (available from Microsoft) on the Win95 platform to use it though. WSH comes with Win98.
This is a modified version of a script Microsoft has in their support pages. In addition to converting to DHCP, this script will disable DNS, switch the WINS button to "Use DHCP for WINS resolution", and delete any gateways the user may have entered.
Dim WSHShell, NList, N, IPAddress, IPMask, IPValue, RegLoc1, RegLoc2, NodeType
Dim Domain, EnableDNS, HostName, NameServer, SearchList, NameServer1, Default Gateway
Set WSHShell = WScript.CreateObject("WScript.Shell")
NList = array("0000","0001","0002","0003","0004","0005","0006", _
"0007","0008","0009","0010")
On Error Resume Next
RegLoc1 = "HKLM\System\CurrentControlSet\Services\Class\NetTrans\"
For Each N In NList
IPValue = "" 'Resets variable
IPAddress = RegLoc1 & N & "\IPAddress"
IPMask = RegLoc1 & N & "\IPMask"
NodeType = RegLoc1 & N & "\NodeType"
NameServer1 = RegLoc1 & N & "\NameServer1"
DefaultGateway = RegLoc1 & N & "\DefaultGateway"
IPValue = WSHShell.RegRead(IPAddress)
If (IPValue <> "") and (IPValue <> "0.0.0.0") then
WSHShell.RegWrite IPAddress,"0.0.0.0"
WSHShell.RegWrite IPMASK,"0.0.0.0"
end If
WSHShell.RegDelete NodeType
WSHShell.RegDelete NameServer1
WSHShell.RegDelete DefaultGateway
Next
RegLoc2 = "HKLM\System\CurrentControlSet\Services\VxD\MSTCP\"
Domain = RegLoc2 & "\Domain"
EnableDNS = RegLoc2 & "\EnableDNS"
HostName = RegLoc2 & "\HostName"
NameServer = RegLoc2 & "\NameServer"
SearchList = RegLoc2 & "\SearchList"
WSHShell.RegDelete Domain
WSHShell.RegDelete HostName
WSHShell.RegDelete NameServer
WSHShell.RegDelete SearchList
WSHShell.RegWrite EnableDNS,"0"
WSHShell.Popup "Your internet settings have been updated. Please reboot."
WScript.Quit ' Tells the script to stop and exit.
If you want to know how to do it on Win NT, check out this article.

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com