I have a script in VBScript that automates the WINS entries (1 Primary and 1 secondary) but has a problem when I try to add more than "1" Secondary WINS entries. Attached is the script and any help will be much appreciated (panjwana@exchange.ml.com).
_________________________________________________________________________
On Error Resume Next
strComputer = "."
strWINSPrimaryServer = "146.125.87.65"
strWINSSecondaryServer = "146.125.40.65"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
WScript.Echo VbCrLf & "Host Name: " & strComputer & VbCrLf & _
" Attempting to set WINS primary and secondary servers ..."
For Each objNicConfig In colNicConfigs
WScript.Echo VbCrLf & _
" Network Adapter " & objNicConfig.Index & VbCrLf & _
" " & objNicConfig.Description
intSetWINSServer = objNicConfig.SetWINSServer(strWINSPrimaryServer, _
strWINSSecondaryServer)
If intSetWINSServer = 0 Then
WScript.Echo " Successfully set WINS servers."
ElseIf intSetWINSServer = 1 Then
WScript.Echo " Successfully set WINS servers." & _
VbCrLf & " Must reboot."
Else
WScript.Echo " Unable to set WINS servers."
End If
Next
WScript.Echo VbCrLf & String(80, "-")
Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each objNicConfig In colNicConfigs
WScript.Echo VbCrLf & _
" Network Adapter " & objNicConfig.Index & VbCrLf & _
" " & objNicConfig.Description
WScript.Echo " Primary WINS Server: " & objNicConfig.WINSPrimaryServer
WScript.Echo " Secondary WINS Server: " & _
objNicConfig.WINSSecondaryServer
Next
____________________________________________________________________________
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...