Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applying WINS setting without DHCP 1

Status
Not open for further replies.

Cstorms

IS-IT--Management
Sep 29, 2006
556
US
How would one go about setting up the WINS ip on a user machine without manual interaction, I dont have the luxury of a Windows DHCP server, I would assume theres a way. No? Thanks.

Cory
 
Strictly standard IPs on a highly maintained cisco setup, regardless, we will not be implementing a DHCP server. I thought maybe a GPO or something but apparently not, maybe a scripted solution somewhere.

Cory
 
oops.. standard = static

Cory
 
Cory have you considered using the NETSH command in the following manner;

netsh interface ip set wins "Local Area Connection" static

You can push it to your user in the form of a script
 
Ahh, awesome, I will give that a go, thanks very much that may work well.

Cory
 
what about script
Code:
strComputer = "."
strWins1 = "192.168.x.x"
strWins2 = "192.168.x.x"


Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set nics = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

For Each nic In nics
  intSetWINS = nic.SetWINSServer(strWINS1, strWINS2)
  If intSetWINSServer = 0 Then
    WScript.Echo "Success! WINS servers configured."
  ElseIf intSetWINSServer = 1 Then
    WScript.Echo "WINS servers configured, please reboot."
  Else
    WScript.Echo "Error!! Unable to configure WINS servers."
  End If
Next
 
Suhweeeet, thanks very much, the script works great.

Cory
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top