Category Archives: Networking

Network adapter Index

A few years ago I wrote a post about setting the IP metric on a connection – https://richardspowershellblog.wordpress.com/2012/01/01/changing-ip-connection-metric/ I was recently asked if the Index’s associated with network adapters were consistent acros machines. The answer – unfortunately- is no they’re … Continue reading

Posted in Networking, PowerShell and WMI | Leave a comment

IP Default Gateways by cmdlet

Following my recent post on setting the default gateway by using the Win32_NetworkAdapterConfiguration CIM class here’s how you do it using the networking cmdlets Discover your adapters Get-NetAdapter Check the default gateway for an adapter Get-NetIPConfiguration -InterfaceIndex 12 | select … Continue reading

Posted in Networking, Powershell | Leave a comment

IP Default Gateways

When you configure the IP Address on a network adapter you also have to set the default gateway if you want the machine to communicate with machines on other subnets. One way you can do this is through the SetGateways … Continue reading

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

CDXML filter parameters

I was recently asked about adding a filter parameter to a cmdlet created through CDXML. If you’ve not seen it before (see PowerShell and WMI Chapters 18 & 19 from http://www.manning.com) CDXML allows you to creat ecmdlets by wrapping a … Continue reading

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

Modifying MAC address

  Another question on the forum brought up an interesting point. User want adapter name and mac address PS> Get-NetAdapter | select Name, MacAddress Name                         MacAddress—-                         ———-WiFi                         28-18-78-D0-05-11Bluetooth Network Connection 28-18-78-D0-05-12 but wanted to remove the hyphens in the mac … Continue reading

Posted in Networking, Powershell Basics | Leave a comment

Parsing ipconfig /displaydns with regular expressions

In yesterdays post I used a series of split operations to parse the strings produced by ipconfig /displaydns Regular expressions should give a more power full way to perform this task. Not being a big fan of regular expressions I … Continue reading

Posted in DNS, Networking, Powershell | Leave a comment

Parsing ipconfig /displaydns

  A recent question on the forum asked how you could get the contents on Windows 7 machines and earlier. On later machines – Windows 8 and above –  its easy because you can use Get-DnsClientCache from the DnsClient module. … Continue reading

Posted in DNS, Networking, PowerShellGet | 1 Comment