Configuring Network Adapter using PowerShell

In this article, I’ll show you how to configure a static IP address on a system that has one network card through PowerShell. This can be useful when you have many servers and you would like to automate the IP addressing.

Below a simple example that will illustrating how you assign a IP address, gateway, and DNS server to a network adapter. The script lists all active network adapters, and when you select one network card and click on OK it uses the hard-coded addresses to assign the new values.

Note: the script above only pretends to do the changes. Remove the -WhatIf parameter to actually assign the new values.

That is it. As you have seen this is a very simple and quick way to change IP settings for a network adapter using PowerShell.

I really like to hear what you have to say about this article:

  • Was this article helpful for you or do you have any questions?
  • Do you have additions, suggestions or any other ideas?
  • Just let me know by leaving a comment below.

Thank you for spending some time at my site and in my blog. I hope you come to visit again soon!

About Lex van der Horst 201 Articles

Be the first to comment

Leave a Reply