Category Archives: Networking

Testing Internet connectivity

I was working on a troubleshooting module and start to think about how I’d go about testing internet connectivity. First you need to determine the network adapter that’s connected to the internet. You can use the network connection profile to … Continue reading

Posted in Networking, Powershell | Leave a comment

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

IPAM: 2 Reading data

Once you have your IPAM server configured you can start to read the data its collected. If you are working against a remote IPAM server than you need to create a CIM session to that machine before doing anything else. … Continue reading

Posted in Networking, Powershell | Leave a comment

IPAM: 1 Installation and configuration

IPAM stands for IP Address Management. It’s a feature in Windows Server 2012 R2 that enables you manage your DHCP and DNS servers as a whole rather than at the individual service or server level. Installation of IPAM follows the … Continue reading

Posted in Networking, Powershell, Windows Server 2012 R2 | Leave a comment