Posts

Showing posts from March, 2015

Powershell: SkipAsSource Flag

Finally ran into an issue where the removal of the primary ip address after Server 2003 caused an issue. Since if you have a multihomed nic the routing table will be set to use the closest IP address to the gateway as the source interface. Here is a fix from  James Kehr to run on your server to set an ip address to be the "Primary" ie Source. I did edit his script by putting a menu and removing the need to put a interface alias. This should only work with 2012 and above with powershell 3.0 and above. For other OS check the heyscriptingguy link.

http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/24/use-powershell-to-change-ip-behavior-with-skipassource.aspx
KB969029

Thank you James Kehr
# set some constants clear Import-Module NetTCPIP Get-NetIPAddress | Where {$_.PrefixOrigin -eq "Manual"} | select IPaddress,InterfaceAlias,SkipasSource | format-table $primaryIP = Read-Host "Which ip address should be set as primary?" $Alias = Get-NetIPAddress $prim…