30-1-2013 Edit – Link to part 3 is here.
In the Exchange 2007 and 2010 world there are definite scenarios where there is a need to add multiple IP addresses to a server so that we can assign specific IP addresses to different web sites. However we do not want clients resolving the Exchange server to multiple A records and getting into a tizzy.
You can a review a previous blog post that I wrote on new functionality that was added to Windows 2008 and Windows 2008 R2 via an update that allows only allowed IP addresses to be registered into DNS. This is a boon especially if you only have a single NIC.
Windows 2012 has this functionality, and also embraces the PowerShell paradigm by providing the same functionality in a PowerShell Cmdlet. Lets review Netsh first then move to PowerShell.
In the below screen shot you can see the Skip As Source parameter:
As a recap, to add the address using Netsh:
Netsh Int IPv4 Add Address <Interface Name> <ip address> SkipAsSource=True
"Interface Name" is the name of the interface for which you want to add a new IP address.
"IP address" is the IP address you want to add to this interface
In my case this was the command used:
Netsh Int IPv4 Add Address Ethernet 192.168.2.201 SkipAsSource=True
And the results can be seen below:
And should you want to remove the IPv4 address using Netsh:
Netsh Int IPv4 Delete Address Ethernet 192.168.2.201
In PowerShell we can achieve the same by leveraging the New-NetIPAddress Cmdlet. First up, let’s take a look at the existing IP addresses via the Get-NetIPAddress cmdlet, and note the current IP of 192.168.2.246 has a value of $False in the SkipAsSource field.
Now let’s add the additional IP address in with the New-NetIPAddress Cmdlet:
New-NetIPAddress -IPAddress 192.168.2.201 -InterfaceAlias Ethernet -SkipAsSource $True
We can see that the SkipAsSource field is set to $True in the above screen shot, and the result is also shown in the Get-NetIPAddress Cmdlet:
Now you go to parties and impress people with how to add IPs and not have then register into DNS.
If you would like to have Microsoft Premier Field Engineering (PFE) visit your company and assist with the topic(s) presented in this blog post, then please contact your Microsoft Premier Technical Account Manager (TAM) for more information on scheduling and our varied offerings!
If you are not currently benefiting from Microsoft Premier support and you’d like more information about Premier, please email the appropriate contact below, and tell them you how you got introduced!
For all other areas please use the US contact point.