Microsoft Windows Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 14 May 2012

Knowing How to Change Your IP Address Using PowerShell

Posted on 14:51 by Unknown

 image

We have already shown you how you can change your IP address from the command prompt, which required long netsh commands, now we are doing the same thing in PowerShell, without the complexity.
Note: The following commands are new in PowerShell v3 and therefore require Windows 8, they also require an administrative command prompt.
 Note: This article is probably for our more geeky audience and requires some basic knowledge of IP Addressing and CIDR notation

Changing Your IP Address

We have seen people pulling out their hair trying to change their IP addresses using cryptic WMI classes in older versions of PowerShell, but that changed with PowerShell v3, there is now a NetTCPIP module that brings most of the functionality to native PowerShell. While a bit confusing at first, mostly due to the lack of documentation at the moment, it starts to make sense once the geeks shows you how its done.
Changing an IP Address can be done using the New-NetIPAddress cmdlet, it has a lot of parameters, some of which, are not even documented in Get-Help. So here it is:
New-NetIPAddress –InterfaceAlias “Wired Ethernet Connection” –IPv4Address “192.168.0.1” –PrefixLength 24 -DefaultGateway 192.168.0.254
This assumes the following:
  • The name of the interface you want to change the IP address  for is Local Area Network
  • You want to statically assign an IP address of 192.168.0.1
  • You want to set a subnet mask of 255.255.255.0 (which is /24 in CIDR notation)
  • You want to set a default gateway of 192.168.0.254

Related Story: Motivational words & Inspirational Quotes "If your mind can accept that something is achievable, it will find a way to attain that thing."


    You would obviously switch the settings out for some that match the addressing criteria for your network.

    Setting Your DNS Information

    Now here comes another tricky part, it turns out that there is a whole separate module called DNSClient that you have to use to manipulate your DNS Settings. To change your DNS Server you would use:
    Set-DnsClientServerAddress -InterfaceAlias “Wired Ethernet Connection” -ServerAddresses 192.168.0.1, 192.168.0.2
    This assumes that you want to set the primary DNS server for Wired Ethernet Connection to 192.168.0.1 and the secondary DNS server to 192.168.0.2. That’s all there is to it.
    Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
    Posted in | No comments
    Newer Post Older Post Home

    0 comments:

    Post a Comment

    Subscribe to: Post Comments (Atom)

    Popular Posts

    • how linux is built
    • Samsung Electronics has bought Boxee
      Samsung Electronics has confirmed its purchase of Boxee on Wednesday for its  smart TVs .  Samsung plans to use this acquisition as a way to...
    • Another Microsoft Guru Steps Down
      Microsoft announced on Monday that company veteran Craig Mundie has stepped down from his post as chief of research and will retire in th...
    • Dr. Dre Top As The New Hip-Hop’s Top Earner
      Six years ago Dr. Dre was walking   for more click here
    • Microsoft new Windows, tablet
      US computing giant Microsoft on Tuesday gave an early peek to the key Chinese market of its new tablet computer and Windows 8 software, pr...
    • Thought words
      “ Greatness lies not in being strong, but in the right using of strength. ” — Henry Ward Beecher
    • How to Move Your Email to Another Mac
      If you use Apple's Mail application, there will probably come a time when you'll want to move your email messages and email account...
    • How To SSH Hop With Key Forwarding from Windows
      In this guide we’ll explain how to SSH to a Linux machine from Windows with your public key, using Putty & Winscp. In addition, we wil...
    • Japan's largest solar and wind power project breaks ground
      Seven Japanese companies have been celebrating the ground breaking of their solar and wind power project at a ceremony held today at the ...
    • How to Recover a Deleted File
      It’s happened to most of us. You delete a file and realize you need it back. This guide will explain when you can get that file back and how...

    Categories

    • 3 D printers
    • 360s
    • amazon
    • android
    • animation
    • apple
    • bing
    • book
    • boxee
    • browser
    • china
    • chrome
    • console
    • dicaprio
    • domain
    • ecommerce
    • facebook
    • ferrari
    • finland
    • gadget
    • galaxy
    • games
    • gmail
    • google
    • hosting
    • HTC
    • internet
    • ipad
    • iphone
    • iphoto
    • iwatch
    • japan
    • keyborad
    • lenovo
    • linux
    • lunar
    • microsoft
    • mobile
    • moon
    • movil
    • ms
    • names
    • new tech
    • Nokia
    • online
    • password
    • pc
    • phone
    • retails
    • samsung
    • search
    • smartphone
    • software
    • space
    • tablet
    • tech
    • text messages
    • track
    • trip
    • usres
    • web
    • whatsapp
    • whois
    • window
    • words
    • xbox

    Blog Archive

    • ►  2013 (160)
      • ►  December (1)
      • ►  November (9)
      • ►  September (5)
      • ►  August (8)
      • ►  July (19)
      • ►  June (12)
      • ►  May (23)
      • ►  April (3)
      • ►  March (5)
      • ►  February (18)
      • ►  January (57)
    • ▼  2012 (340)
      • ►  December (25)
      • ►  November (34)
      • ►  October (24)
      • ►  September (27)
      • ►  August (26)
      • ►  July (46)
      • ►  June (83)
      • ▼  May (42)
        • Final test version of Windows 8 released
        • The Pros And Cons Of Using Cloud Hosting
        • China: The world's cleverest country?
        • 40 percent of Germany’s electricity demand this we...
        • Samsung to start selling Galaxy S3 in 28 nations
        • Britain : Do UK need an Aircraft Carrier?
        • Facebook is making a phone, are you aware?
        • Browser wars flare in mobile space
        • Yahoo! ditches digital newsstand for iPads
        • China fund may help Alibaba in Yahoo! bid: report
        • The Growing Vietnam's new technology entrepreneurs...
        • Installing an RPM Package on Ubuntu Linux
        • How Do Linux File Permissions Work?
        • Google in patent fight with Oracle
        • Are the police tracking your calls?
        • Is China becoming the biggest app market for smart...
        • Sheryl Sandberg, the Woman Behind Facebook's Busin...
        • Microsoft launches has lauched its own facebook
        • is Google chrome overtaking internet explorer as #...
        • Uk cities to get Super - connected
        • Japan Lunches SouthKorea Satellite
        • Alibaba buys half of Yahoo stake for $7.1bn
        • Facebook First Female Engineer
        • Facebook founder Mark Zuckerberg Wed His Long time...
        • Knowing How To Connect a Bluetooth Keyboard to an ...
        • Knowing How to Change Your Mac's DNS Servers
        • UK: British surveillance program To expose private...
        • Internet: China mobile online user top 1.1billion
        • see how people uses facebook by numbers
        • World cheapest computer priced at $25. Will it rev...
        • facebook has made Bono, the richest musician in th...
        • will facebook becomes the first trillion dollars c...
        • Face has added 84 Million More Shares For Sale
        • Will Facebook IPO bring cash and changes to the c...
        • Knowing How to Change Your IP Address Using PowerS...
        • Facebook plans to start charging you money for you...
        • Is Facebook ahead IPO excitement creating intensity?
        • Youtube: Do video sharing app demise youtube?
        • FACEBOOK:will you give up your citizenship just be...
        • 'Angry Birds' Game Maker to Lunch a New Game calle...
        • music-movie streaming firm mSpot, is being bought ...
        • Facebook buys Glancee a mobile discovery startup
      • ►  April (33)
    Powered by Blogger.

    About Me

    Unknown
    View my complete profile