I found the script,
sNameSpace = "root/CIMV2"
sTargetClass = "Win32_NetworkAdapterConfiguration"
sClass = "Win32_NetworkAdapter"
sProperty1 = "AdapterType"
sValue1 = "Ethernet 802.3"
sProperty2 = "NetConnectionStatus"
iValue2 = 2
sComputer = "India"
sPriWINS = "1.2.3.4"
sSecWINS = "1.2.4.3"
aDNSServers = Array("1.2.2.1","1.2.3.5")
sDNSDomain = "swynk.com"
iNetBIOS = 1
sWQLQuery = "SELECT * FROM " & sClass & " WHERE " & sProperty1 & "=" &
Chr(34) & sValue1 & Chr(34) & _
" AND " & sProperty2 & "=" & iValue2
Set cInstances = GetObject("winmgmts:{impersonationLevel=impersonat e}//" & _
sComputer & "/" & sNameSpace).ExecQuery(sWQLQuery, "WQL")
For Each oInstance In cInstances
Set cAssociators = oInstance.Associators_(,sTargetClass)
For Each oAssociator In cAssociators
Set oMethod = oAssociator.Methods_("SetWINSServer")
Set oInParam = oMethod.InParameters.SpawnInstance_()
oInParam.WINSPrimaryServer = sPriWINS
oInParam.WINSSecondaryServer = sSecWINS
Set oOutParam = oAssociator.ExecMethod_("SetWINSServer", oInParam)
If oOutParam.returnValue = 0 Then
WScript.Echo UCase("SetWINSServer") & " method completed successfully"
Else
WScript.Echo UCase("SetWINSServer") & " method failed. Error Number " &
oOutParam.returnValue
End If
Set oMethod = oAssociator.Methods_("SetDNSServerSearchOrder")
Set oInParam = oMethod.InParameters.SpawnInstance_()
oInParam.DNSServerSearchOrder = aDNSServers
Set oOutParam = oAssociator.ExecMethod_("SetDNSServerSearchOrder", oInParam)
If oOutParam.returnValue = 0 Then
WScript.Echo UCase("SetDNSServerSearchOrder") & " method completed
successfully"
Else
WScript.Echo UCase("SetDNSServerSearchOrder") & " method failed. Error
Number " & oOutParam.returnValue
End If
Set oMethod = oAssociator.Methods_("SetDNSDomain")
Set oInParam = oMethod.InParameters.SpawnInstance_()
oInParam.DNSDomain = sDNSDomain
Set oOutParam = oAssociator.ExecMethod_("SetDNSDomain", oInParam)
If oOutParam.returnValue = 0 Then
WScript.Echo UCase("SetDNSDomain") & " method completed successfully"
Else
WScript.Echo UCase("SetDNSDomain") & " method failed. Error Number " &
oOutParam.returnValue
End If
Set oMethod = oAssociator.Methods_("SetTCPIPNetBIOS")
Set oInParam = oMethod.InParameters.SpawnInstance_()
oInParam.TcpipNetBIOSOptions = iNetBIOS
Set oOutParam = oAssociator.ExecMethod_("SetTCPIPNetBIOS", oInParam)
If oOutParam.returnValue = 0 Then
WScript.Echo UCase("SetTCPIPNetBIOS") & " method completed successfully"
Else
WScript.Echo UCase("SetTCPIPNetBIOS") & " method failed. Error Number " &
oOutParam.returnValue
End If
Next
Next
"Marcus Robinson" wrote:
> Take a look at http://msdn.microsoft.com/en-us/libr...17(VS.85).aspx
>
> Also a quick Google for an example came back with
> http://www.enterpriseitplanet.com/re...le.php/3082511
>
> Perhaps can take something from them?
>
> Marcus
>
>
> --
> Blog - http://www.techdiction.com
> MR ICT Ltd - http://www.mrict.co.uk
>
>
> "Ezakial" <> wrote in message
> news:1E0DA830-5A9C-4833-AA27-...
> > I'm looking for a script which can change the static IP address such as
> > Host
> > IP address, DNS IP, WINS IP, Gateway IP, & Subnet mask of remote Windows
> > Server 2k/2k3.
> >
> > I have 300+ servers on which I have to remotely logon and update the above
> > mentioned details which is tedious task.
> >
> > If anyone has a script to achieve this , I would be very thankful.
> >
> > Thanks
>
>