Would you like to learn how to configure a static IP address on a network interface of Windows using Powershell? In this tutorial, we are going to show you how to use Powershell to configure a static IP address on a network interface of a computer running Windows.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10
• Windows 7

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Related tutorial – PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell – Configure a static IP address

As an Administrator, start an elevated Powershell command-line.

Windows 10 - powershell elevated

List all network adapters available.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Take note of the desired network interface index.

Remove any IP address configuration from the network adapter.

Copy to Clipboard

Remove any DNS configuration from the network adapter.

Copy to Clipboard

Configure a static IP address on a network interface.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Configure the DNS servers of a network adapter.

Copy to Clipboard

Verify the DNS servers configured on a network interface.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the configuration of a network interface.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, the network adapter selected has index number 22.

In our example, we configured the IP address 10.10.10.2 on the network interface.

In our example, we configured the default gateway IP address 10.10.10.1.

In our example, we configured the DNS addresses 8.8.8.8 and 8.8.4.4 on the network interface.

Congratulations! You are able to configure a static IP address on a network interface using Powershell.