Category Archives: Networking

Using Invoke-WmiMethod to set the DNS servers

In the last post I showed that there was an issue with the way the SetDNSServerSearchOrder of the Win32_NetworkAdapterConfiguration class worked This would work $nic = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter “Index=7″$nic.SetDNSServerSearchOrder(“10.10.54.201″) but using Invoke-WmiMethod failed After discussions with Bartek Bielawski … Continue reading

Posted in Networking, PowerShell and WMI, PowerShell V2, PowerShell V3 | Leave a comment

TCP/IP Alternative Configurations: pt IV reset to static address

At some stage we may need to reset our NIC back to having a static address $index = 7 $nic = Get-WmiObject -Class Win32_NetworkAdapterConfiguration ` -Filter “Index=$index” $ipaddress = @(“10.10.54.202″) $subnet = @(“255.255.255.0″) Invoke-WmiMethod -InputObject $nic -Name EnableStatic -ArgumentList $ipaddress, … Continue reading

Posted in Networking, PowerShell and WMI | Leave a comment

TCP/IP Alternative Configurations: pt III set the alternative configuration

  We have seen how to set the NIC to use DHCP to get its address. This post shows how to set the alternative configuration on the NIC. If you just  want APIPA then do nothing – other wise use … Continue reading

Posted in Networking, PowerShell V2, PowerShell V3 | Leave a comment

TCP/IP Alternative Configuration: pt II Set DHCP

The next step on our journey to an alternative configuration is setting the NIC to use DHCP I will keep cheating for now and specify the NIC – on my machine I now it is the NIC whose Win32_NetworkAdapterConfiguration has … Continue reading

Posted in Networking, Powershell, PowerShell and WMI | Leave a comment

TCP/IP Alternative Configuration: pt I The configuration

A question on the forum got me wondering about setting the Alternative Configuration on a TCP/IP properties of a network adapter. NICs are normally configured to either DHCP or a static address. If you use DHCP another tab “Alternative Configuration” … Continue reading

Posted in Networking, PowerShell and WMI | Leave a comment

Setting a Network address in Windows Server 8

  Windows Server 8 & Windows 8 bring a host of new functionality to us. I wanted to try out some of it so created a new VM and installed the OS – went for full GUI for now Opened … Continue reading

Posted in Networking, PowerShell and WMI, PowerShell V3, Windows 8 Server | Leave a comment

Changing IP Connection Metric

A question on the forums asked how the connection metrics could be set on a Windows system. We need to start by identifying the network adapters using this function function test-ipmetric { Get-WmiObject -Class Win32_NetworkAdapter -Filter “AdapterType = ‘Ethernet 802.3′” … Continue reading

Posted in Networking, PowerShell and WMI | Leave a comment

Hosts file – add an IPv6 address

This builds on adding an IPv4 address – http://msmvps.com/blogs/richardsiddaway/archive/2011/10/24/hosts-file-add-a-record.aspx function add-IPv6hostfilecontent { [CmdletBinding()] param ( [parameter(Mandatory=$true)] [string]$IPAddress, [parameter(Mandatory=$true)] [string]$computer ) $file = Join-Path -Path $($env:windir) -ChildPath “system32\drivers\etc\hosts” if (-not (Test-Path -Path $file)){ Throw “Hosts file not found” } $data = … Continue reading

Posted in Networking, PowerShell V2 | 1 Comment

IPv6 Link local addresses and device identifier

If I run ipconfig on my system the partial results are this Wireless LAN adapter Wireless Network Connection:    Connection-specific DNS Suffix  . : tiscali.co.uk    Link-local IPv6 Address . . . . . : fe80::6d95:b824:6a72:a0a9%11    IPv4 Address. . … Continue reading

Posted in Networking, PowerShell and WMI | Leave a comment

Working with IPv6

A comment was left on one of the articles in my recent series on working with the hosts file asking about using IPv6.  I’ve not used it really as I’ve never had any reason but it seems a good idea … Continue reading

Posted in Networking, PowerShell and WMI, PowerShell V2 | Leave a comment