Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > IP "Alternate configuration"

Reply
Thread Tools Display Modes

IP "Alternate configuration"

 
 
SubnetJO
Guest
Posts: n/a

 
      05-20-2009
Hi all.

Surely you know that if you set a network interface to be configured
dinamically by a DHCP server, you have the "Alternate Configuration" TAB
where you can place a static IP configuration in the case the dynamic
configuration process fails (for any reason).

I'd like to set the (IP) "alternate configuration" programmatically, using a
script (VBS, VB, PowerShell, Netsh... doesn't matter), and I couldn't find a
documentation about.

Can any of you provide me a way to accomplish this task?
A sample code would be great!

Really thank you for your help.
SubnetJO, Italy
 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      05-21-2009

"SubnetJO" <> wrote in message
news:4D32F41D-F456-4157-A020-...
> Hi all.
>
> Surely you know that if you set a network interface to be configured
> dinamically by a DHCP server, you have the "Alternate Configuration" TAB
> where you can place a static IP configuration in the case the dynamic
> configuration process fails (for any reason).
>
> I'd like to set the (IP) "alternate configuration" programmatically, using
> a
> script (VBS, VB, PowerShell, Netsh... doesn't matter), and I couldn't find
> a
> documentation about.
>
> Can any of you provide me a way to accomplish this task?
> A sample code would be great!
>
> Really thank you for your help.
> SubnetJO, Italy


I cannot see any "Alternate Configuration" tab on my machine. Regardless of
this, the usual command to set IP parameters is netsh.exe. You can use it to
set fixed IP addresses or use DHCP.


 
Reply With Quote
 
SubnetJO
Guest
Posts: n/a

 
      05-21-2009
Thank for your reply.

I mean...
Take a WinXPpro machine.
Control Panel > Network Connections

On an Ethernet Interface:
Right click > properties

On the general tab, choose "Internet Protocol (TCP/IP)" and then click the
Properties button.

In the "Internet Protocol (TCP/IP) Properties" window, If the interface is
configured to "Obtain an IP address automatically" (on the "General tab"),
you can see the "alternate configuration" tab too.

On this tab you can set a static IP configuration for the case the automatic
configuration (DHCP) fails.

I can set the IP configuration in many ways, including the Netsh.exe
utility, but I didn't find a way to programmatically place the alternate IP
configuration.

Thanks,
SubnetJO, Italy







"Pegasus [MVP]" wrote:

>
> "SubnetJO" <> wrote in message
> news:4D32F41D-F456-4157-A020-...
> > Hi all.
> >
> > Surely you know that if you set a network interface to be configured
> > dinamically by a DHCP server, you have the "Alternate Configuration" TAB
> > where you can place a static IP configuration in the case the dynamic
> > configuration process fails (for any reason).
> >
> > I'd like to set the (IP) "alternate configuration" programmatically, using
> > a
> > script (VBS, VB, PowerShell, Netsh... doesn't matter), and I couldn't find
> > a
> > documentation about.
> >
> > Can any of you provide me a way to accomplish this task?
> > A sample code would be great!
> >
> > Really thank you for your help.
> > SubnetJO, Italy

>
> I cannot see any "Alternate Configuration" tab on my machine. Regardless of
> this, the usual command to set IP parameters is netsh.exe. You can use it to
> set fixed IP addresses or use DHCP.
>
>
>

 
Reply With Quote
 
SubnetJO
Guest
Posts: n/a

 
      05-21-2009

Thank for your reply.

I mean...
Take a WinXPpro machine.
Control Panel > Network Connections

On an Ethernet Interface:
Right click > properties

On the general tab, choose "Internet Protocol (TCP/IP)" and then click the
Properties button.

In the "Internet Protocol (TCP/IP) Properties" window, If the interface is
configured to "Obtain an IP address automatically" (on the "General tab"),
you can see the "alternate configuration" tab too.

On this tab you can set a static IP configuration for the case the automatic
configuration (DHCP) fails.

I can set the IP configuration in many ways, including the Netsh.exe
utility, but I didn't find a way to programmatically place the alternate IP
configuration.

Thanks,
SubnetJO, Italy


"Pegasus [MVP]" wrote:

>
> "SubnetJO" <> wrote in message
> news:4D32F41D-F456-4157-A020-...
> > Hi all.
> >
> > Surely you know that if you set a network interface to be configured
> > dinamically by a DHCP server, you have the "Alternate Configuration" TAB
> > where you can place a static IP configuration in the case the dynamic
> > configuration process fails (for any reason).
> >
> > I'd like to set the (IP) "alternate configuration" programmatically, using
> > a
> > script (VBS, VB, PowerShell, Netsh... doesn't matter), and I couldn't find
> > a
> > documentation about.
> >
> > Can any of you provide me a way to accomplish this task?
> > A sample code would be great!
> >
> > Really thank you for your help.
> > SubnetJO, Italy

>
> I cannot see any "Alternate Configuration" tab on my machine. Regardless of
> this, the usual command to set IP parameters is netsh.exe. You can use it to
> set fixed IP addresses or use DHCP.
>
>
>

 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a

 
      05-21-2009
"Tabs" are used in GUIs (Graphical User Interfaces). Since you're after a
scriptable solution you need something that controls the same parameters
that your tab does. As I mentioned before, netsh.exe can do this. The
following command is an example: It will set the adapter to DHCP mode.

netsh interface ip set address "Local Area Connection" DHCP

If you want to alter between DHCP and a fixed address then you need two
netsh commands: One to enable DHCP, the other to set fixed addresses (which
are embedded in your command).


"SubnetJO" <> wrote in message
news:62E01BE6-3940-4551-8212-...
> Thank for your reply.
>
> I mean...
> Take a WinXPpro machine.
> Control Panel > Network Connections
>
> On an Ethernet Interface:
> Right click > properties
>
> On the general tab, choose "Internet Protocol (TCP/IP)" and then click the
> Properties button.
>
> In the "Internet Protocol (TCP/IP) Properties" window, If the interface is
> configured to "Obtain an IP address automatically" (on the "General tab"),
> you can see the "alternate configuration" tab too.
>
> On this tab you can set a static IP configuration for the case the
> automatic
> configuration (DHCP) fails.
>
> I can set the IP configuration in many ways, including the Netsh.exe
> utility, but I didn't find a way to programmatically place the alternate
> IP
> configuration.
>
> Thanks,
> SubnetJO, Italy
>
>
>
>
>
>
>
> "Pegasus [MVP]" wrote:
>
>>
>> "SubnetJO" <> wrote in message
>> news:4D32F41D-F456-4157-A020-...
>> > Hi all.
>> >
>> > Surely you know that if you set a network interface to be configured
>> > dinamically by a DHCP server, you have the "Alternate Configuration"
>> > TAB
>> > where you can place a static IP configuration in the case the dynamic
>> > configuration process fails (for any reason).
>> >
>> > I'd like to set the (IP) "alternate configuration" programmatically,
>> > using
>> > a
>> > script (VBS, VB, PowerShell, Netsh... doesn't matter), and I couldn't
>> > find
>> > a
>> > documentation about.
>> >
>> > Can any of you provide me a way to accomplish this task?
>> > A sample code would be great!
>> >
>> > Really thank you for your help.
>> > SubnetJO, Italy

>>
>> I cannot see any "Alternate Configuration" tab on my machine. Regardless
>> of
>> this, the usual command to set IP parameters is netsh.exe. You can use it
>> to
>> set fixed IP addresses or use DHCP.
>>
>>
>>



 
Reply With Quote
 
SubnetJO
Guest
Posts: n/a

 
      05-21-2009
Sure...
I want to programmatically change the parameters usually altered via GUI, in
the TAB "Alternate Conguration".

Yes.
I want a script that changes that parameters and then re-open the tab and
find them configured.

I hope I have been more clear, now.

What you suggest is not what I mean.
I'm already able to configure an interface via Netsh, and I don't want to
"alternate" between two interface configurations (fixed and dynamic).

I want to configure my interface to obtain the configuration automatically
via DHCP.
OK, assuming I have called my interface "LAN", I can use the command "set
addr LAN DHCP" under the netsh to accomplish this.

Now I have my interface "LAN" DHCP enabled...
In the case of a failure of the DHCP service (after 1 munute), the interface
"LAN" will be (automatically, silently) configured with the values (IP subnet
mask, gateway...) set on the ALTERNATE CONFIGURATION TAB.

I don't want to fix the LAN interface configuration!
I want to still have it configured via DHCP!
I want to set that ALTERNATE (fixed) IP configuration.

Doing this via GUI is an easy job, I want to do the same via VBS (preferred).

Is it possible?

I hobe I was clearer

SubnetJO, Italy






"Pegasus [MVP]" wrote:

> "Tabs" are used in GUIs (Graphical User Interfaces). Since you're after a
> scriptable solution you need something that controls the same parameters
> that your tab does. As I mentioned before, netsh.exe can do this. The
> following command is an example: It will set the adapter to DHCP mode.
>
> netsh interface ip set address "Local Area Connection" DHCP
>
> If you want to alter between DHCP and a fixed address then you need two
> netsh commands: One to enable DHCP, the other to set fixed addresses (which
> are embedded in your command).
>
>
> "SubnetJO" <> wrote in message
> news:62E01BE6-3940-4551-8212-...
> > Thank for your reply.
> >
> > I mean...
> > Take a WinXPpro machine.
> > Control Panel > Network Connections
> >
> > On an Ethernet Interface:
> > Right click > properties
> >
> > On the general tab, choose "Internet Protocol (TCP/IP)" and then click the
> > Properties button.
> >
> > In the "Internet Protocol (TCP/IP) Properties" window, If the interface is
> > configured to "Obtain an IP address automatically" (on the "General tab"),
> > you can see the "alternate configuration" tab too.
> >
> > On this tab you can set a static IP configuration for the case the
> > automatic
> > configuration (DHCP) fails.
> >
> > I can set the IP configuration in many ways, including the Netsh.exe
> > utility, but I didn't find a way to programmatically place the alternate
> > IP
> > configuration.
> >
> > Thanks,
> > SubnetJO, Italy
> >
> >
> >
> >
> >
> >
> >
> > "Pegasus [MVP]" wrote:
> >
> >>
> >> "SubnetJO" <> wrote in message
> >> news:4D32F41D-F456-4157-A020-...
> >> > Hi all.
> >> >
> >> > Surely you know that if you set a network interface to be configured
> >> > dinamically by a DHCP server, you have the "Alternate Configuration"
> >> > TAB
> >> > where you can place a static IP configuration in the case the dynamic
> >> > configuration process fails (for any reason).
> >> >
> >> > I'd like to set the (IP) "alternate configuration" programmatically,
> >> > using
> >> > a
> >> > script (VBS, VB, PowerShell, Netsh... doesn't matter), and I couldn't
> >> > find
> >> > a
> >> > documentation about.
> >> >
> >> > Can any of you provide me a way to accomplish this task?
> >> > A sample code would be great!
> >> >
> >> > Really thank you for your help.
> >> > SubnetJO, Italy
> >>
> >> I cannot see any "Alternate Configuration" tab on my machine. Regardless
> >> of
> >> this, the usual command to set IP parameters is netsh.exe. You can use it
> >> to
> >> set fixed IP addresses or use DHCP.
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
\Rems
Guest
Posts: n/a

 
      05-27-2009
"SubnetJO" wrote:

> Sure...
> I want to programmatically change the parameters usually altered via GUI, in
> the TAB "Alternate Conguration".
>
> Yes.
> I want a script that changes that parameters and then re-open the tab and
> find them configured.
>
> I hope I have been more clear, now.
>
> What you suggest is not what I mean.
> I'm already able to configure an interface via Netsh, and I don't want to
> "alternate" between two interface configurations (fixed and dynamic).
>
> I want to configure my interface to obtain the configuration automatically
> via DHCP.
> OK, assuming I have called my interface "LAN", I can use the command "set
> addr LAN DHCP" under the netsh to accomplish this.
>
> Now I have my interface "LAN" DHCP enabled...
> In the case of a failure of the DHCP service (after 1 munute), the interface
> "LAN" will be (automatically, silently) configured with the values (IP subnet
> mask, gateway...) set on the ALTERNATE CONFIGURATION TAB.
>
> I don't want to fix the LAN interface configuration!
> I want to still have it configured via DHCP!
> I want to set that ALTERNATE (fixed) IP configuration.
>
> Doing this via GUI is an easy job, I want to do the same via VBS (preferred).
>
> Is it possible?
>
> I hobe I was clearer
>
> SubnetJO, Italy
>
>
>
>
>
>
> "Pegasus [MVP]" wrote:
>
> > "Tabs" are used in GUIs (Graphical User Interfaces). Since you're after a
> > scriptable solution you need something that controls the same parameters
> > that your tab does. As I mentioned before, netsh.exe can do this. The
> > following command is an example: It will set the adapter to DHCP mode.
> >
> > netsh interface ip set address "Local Area Connection" DHCP
> >
> > If you want to alter between DHCP and a fixed address then you need two
> > netsh commands: One to enable DHCP, the other to set fixed addresses (which
> > are embedded in your command).
> >
> >
> > "SubnetJO" <> wrote in message
> > news:62E01BE6-3940-4551-8212-...
> > > Thank for your reply.
> > >
> > > I mean...
> > > Take a WinXPpro machine.
> > > Control Panel > Network Connections
> > >
> > > On an Ethernet Interface:
> > > Right click > properties
> > >
> > > On the general tab, choose "Internet Protocol (TCP/IP)" and then click the
> > > Properties button.
> > >
> > > In the "Internet Protocol (TCP/IP) Properties" window, If the interface is
> > > configured to "Obtain an IP address automatically" (on the "General tab"),
> > > you can see the "alternate configuration" tab too.
> > >
> > > On this tab you can set a static IP configuration for the case the
> > > automatic
> > > configuration (DHCP) fails.
> > >
> > > I can set the IP configuration in many ways, including the Netsh.exe
> > > utility, but I didn't find a way to programmatically place the alternate
> > > IP
> > > configuration.
> > >
> > > Thanks,
> > > SubnetJO, Italy
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > "Pegasus [MVP]" wrote:
> > >
> > >>
> > >> "SubnetJO" <> wrote in message
> > >> news:4D32F41D-F456-4157-A020-...
> > >> > Hi all.
> > >> >
> > >> > Surely you know that if you set a network interface to be configured
> > >> > dinamically by a DHCP server, you have the "Alternate Configuration"
> > >> > TAB
> > >> > where you can place a static IP configuration in the case the dynamic
> > >> > configuration process fails (for any reason).
> > >> >
> > >> > I'd like to set the (IP) "alternate configuration" programmatically,
> > >> > using
> > >> > a
> > >> > script (VBS, VB, PowerShell, Netsh... doesn't matter), and I couldn't
> > >> > find
> > >> > a
> > >> > documentation about.
> > >> >
> > >> > Can any of you provide me a way to accomplish this task?
> > >> > A sample code would be great!
> > >> >
> > >> > Really thank you for your help.
> > >> > SubnetJO, Italy
> > >>
> > >> I cannot see any "Alternate Configuration" tab on my machine. Regardless
> > >> of
> > >> this, the usual command to set IP parameters is netsh.exe. You can use it
> > >> to
> > >> set fixed IP addresses or use DHCP.
> > >>


The script (startup script) should edit the registry on the client,
First determine the currently connected NIC and retrieve the interface's GUID.
Then the script will,
- add the Alternate Configurations to a new subkey under the DHCP service
configuration with a reference to the interface's GUID. The full
configuration is stored in one Binary registry entry in this subkey.
- Then to enable the Option for Alternate Config for the actual network
interface, create a reference to the new subkey under the existing
interface's GUID subkey of the tcpip Service parameters in the registry.


\Rems
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"startup" tab on "system configuration utility" BoazBoaz Internet Explorer 2 02-12-2009 04:17 PM
Can't see alternate "reply to" address on WLM desktop flibmeister Windows Live Mail 7 04-30-2008 12:04 AM
any way to enable "alternate data streams" in Vista ? Max Windows Vista File Management 3 03-18-2008 07:04 PM
Alternate "Recorded TV" source Jon Davis Windows Vista Music, Pictures and Video 5 12-06-2006 07:05 PM
Authenticate "foreign" machine from alternate domain Gray McCord Active Directory 1 04-01-2004 03:33 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59