Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



how to change default gateway

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-03-2008
tdubb
 
Posts: n/a
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?



Reply With Quote
  #2  
Old 28-03-2008
Pegasus \(MVP\)
 
Posts: n/a
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


Reply With Quote
  #3  
Old 30-03-2008
Remco
 
Posts: n/a
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?
>



Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "how to change default gateway"
Thread Thread Starter Forum Replies Last Post
Default gateway unavailable in windows 7 LynDa55 Networking & Security 5 09-12-2010 11:03 PM
Default Gateway Problem kodiedawg Networking & Security 1 26-05-2010 12:38 AM
WHY DOES OUTLOOK 2007 NEED A DEFAULT GATEWAY?????? Q Jones Office Setup 2 08-09-2009 07:33 AM
Can't get default gateway SamDust Networking & Security 4 01-07-2009 11:26 PM
Default Gateway is not available? docmarten Networking & Security 3 25-03-2009 11:04 AM


All times are GMT +5.5. The time now is 10:25 AM.