PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms..win.server.scripting > automate the properties TCP/IP
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
automate the properties TCP/IP

Réponse
 
LinkBack Outils de la discussion
Vieux 27/09/2007, 00h26   #1 (permalink)
gustavo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut automate the properties TCP/IP

It is possible to create a script to automate the properties TCP/IP on
multiple clients, where this script takes to which properties TCP/IP that her
belong(concern).

Thank you for your since they are too many equipments
  Réponse avec citation
Vieux 27/09/2007, 15h21   #2 (permalink)
urkec
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: automate the properties TCP/IP

"gustavo" wrote:

> It is possible to create a script to automate the properties TCP/IP on
> multiple clients, where this script takes to which properties TCP/IP that her
> belong(concern).
>
> Thank you for your since they are too many equipments


Try this link for some samples:

http://www.microsoft.com/technet/scr...k/default.mspx


--
urkec
  Réponse avec citation
Vieux 11/10/2007, 14h08   #3 (permalink)
John W
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: automate the properties TCP/IP

Here's a script i use. It does dns, ip, subnet, wins, etc. There might be
some extra code in here that doesn't need to be here, but it all works.

--START--


strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array("172.20.12.1")
strSubnetMask = Array("255.255.0.0")
strGateway = Array("172.20.0.1")
strGatewayMetric = Array(1)
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
If errEnable = 0 Then

Else

End If
Next

arrNewDNSServerSearchOrder = Array("10.0.0.6", "10.0.0.22", "10.0.0.23")

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



For Each objNicConfig In colNicConfigs

If Not IsNull(objNicConfig.DNSServerSearchOrder) Then
For Each strDNSServer In objNicConfig.DNSServerSearchOrder

Next
End If
intSetDNSServers = _
objNicConfig.SetDNSServerSearchOrder(arrNewDNSServ erSearchOrder)
If intSetDNSServers = 0 Then

Else
WScript.Echo " Unable to replace DNS server search order list."
End If
Next



Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

For Each objNicConfig In colNicConfigs


If Not IsNull(objNicConfig.DNSServerSearchOrder) Then
For Each strDNSServer In objNicConfig.DNSServerSearchOrder

Next
End If
Next

strWINSPrimaryServer = "10.0.0.6"
strWINSSecondaryServer = "10.0.0.22"

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



For Each objNicConfig In colNicConfigs

intSetWINSServer = objNicConfig.SetWINSServer(strWINSPrimaryServer, _
strWINSSecondaryServer)
If intSetWINSServer = 0 Then

ElseIf intSetWINSServer = 1 Then

Else

End If
Next



Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

For Each objNicConfig In colNicConfigs


Next

WScript.Echo "The IP address and all that bacon has been changed!."



--END--





"gustavo" <gustavo@discussions.microsoft.com> wrote in message
news:7DC8575A-8B3E-4DA3-8418-C4138ED48F6B@microsoft.com...
> It is possible to create a script to automate the properties TCP/IP on
> multiple clients, where this script takes to which properties TCP/IP that
> her
> belong(concern).
>
> Thank you for your since they are too many equipments



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h41.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08474 seconds with 11 queries