how to change default gateway
Here is my script to change the ip address, mash and default gateway but the
default gateway is not being changed
strComputer = "."
IPAddress = InputBox("Enter IP Address")
SubnetMask = InputBox("Enter Subnet Mask")
DefaultGateway = InputBox("Enter Default Gateway")
arrIPAddress = Array(IPAddress)
arrSubnetMask = Array(SubnetMask)
arrDefaultGateway = Array(DefaultGateway)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from
Win32_NetworkAdapterConfiguration")
For Each objNetAdapter in colNetAdapters
errEnableStatic = objNetAdapter.EnableStatic(arrIPAddress,
arrSubnetMask, arrDefaultGateway)
Next
any idea?
Re: how to change default gateway
"tdubb" <tdubb123@gmail.com> wrote in message
news:%23eUPgGGkIHA.3780@TK2MSFTNGP06.phx.gbl...
> Here is my script to change the ip address, mash and default gateway but
> the default gateway is not being changed
>
> strComputer = "."
> IPAddress = InputBox("Enter IP Address")
> SubnetMask = InputBox("Enter Subnet Mask")
> DefaultGateway = InputBox("Enter Default Gateway")
> arrIPAddress = Array(IPAddress)
> arrSubnetMask = Array(SubnetMask)
> arrDefaultGateway = Array(DefaultGateway)
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> Set colNetAdapters = objWMIService.ExecQuery("Select * from
> Win32_NetworkAdapterConfiguration")
> For Each objNetAdapter in colNetAdapters
> errEnableStatic = objNetAdapter.EnableStatic(arrIPAddress,
> arrSubnetMask, arrDefaultGateway)
> Next
>
> any idea?
>
This link might help:
Automating TCP/IP Networking on Clients
http://www.microsoft.com/technet/scr...tnc_basic.mspx
Re: how to change default gateway
it's not in the DHCP scope options ??
"tdubb" <tdubb123@gmail.com> schreef in bericht
news:%23eUPgGGkIHA.3780@TK2MSFTNGP06.phx.gbl...
> Here is my script to change the ip address, mash and default gateway but
> the default gateway is not being changed
>
> strComputer = "."
> IPAddress = InputBox("Enter IP Address")
> SubnetMask = InputBox("Enter Subnet Mask")
> DefaultGateway = InputBox("Enter Default Gateway")
> arrIPAddress = Array(IPAddress)
> arrSubnetMask = Array(SubnetMask)
> arrDefaultGateway = Array(DefaultGateway)
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> Set colNetAdapters = objWMIService.ExecQuery("Select * from
> Win32_NetworkAdapterConfiguration")
> For Each objNetAdapter in colNetAdapters
> errEnableStatic = objNetAdapter.EnableStatic(arrIPAddress,
> arrSubnetMask, arrDefaultGateway)
> Next
>
> any idea?
>