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"...
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 this script $HKLM = 2147483650 #HKEY_LOCAL_MACHINE...
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 ,...
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 to dig into it a bit as IPv6 is enabled by default...
Quick revision to the post on reading the hosts file http://msmvps.com/blogs/richardsiddaway/archive/2011/10/23/reading-the-hosts-file.aspx . I wanted to be able to display the whole file function get-hostfilecontent { param ( [switch] $all ) $file =...
We seen how to delete a single entry from the hosts file – this is how we clear all entries function clear-hostfilecontent { [ CmdletBinding ( ) ] param ( ) $file = Join-Path -Path $( $env:windir ) -ChildPath "system32\drivers\etc\hosts" if...
Next up is removing a record from a hosts file function remove-hostfilecontent { [ CmdletBinding ( ) ] param ( [ parameter ( Mandatory = $true ) ] [ ValidatePattern ( "\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b" ) ] [string] $IPAddress , [ parameter...
We’ve seen how to read the Hosts file – this is how we add a record function add-hostfilecontent { [ CmdletBinding ( SupportsShouldProcess = $true ) ] param ( [ parameter ( Mandatory = $true ) ] [ ValidatePattern ( "\b\d{1,3}\.\d{1,3}\.\d{1,3}\....
Normally I ignore the Hosts file but my development laptop isn’t a member of my test domain – a number of reasons for this which I won’t go into. This means that when I want to RDP to a machine in the test domain I have to use the IP address. A bit awkward...
One task that comes up from time to time is changing the network address on a system. The subnet may be the same but we need to change the last octet of the address We can find an address using Test-Connection PS (1) > test-connection server02 Source ...