Change MAC Address with PowerShell of a Wireless Adapter

As I mentioned in my post a week ago, I’m commuting each day and there is a 200MB Quota on the Wireless Network. Luckily it’s based on the MAC Address of the WiFi Card, so it’s quite easy to get another 200MB Quota if you want  😉

wifi1

Here is my small powershell script that automatically Releases the IP Address, set’s a new random MAC Address and Re-Connects to the SSID, all done in a second or two.
Yay! Another 200MB Quota to burn.

 

I’m using a Window 10 client with Hyper-V, and I’ve created a Virtual NIC for the WiFi adapter, that’s why it’s called ‘vEthernet (External Wi-Fi)’.  But you should be able to use the script with a normal WiFi Adapter too.

I’m using a Virtual WiFi Adapter, to be able to give my Virtual Machines access to internet also when I’m without a LAN.

Here is the script for creating a Virtual WiFi NIC;

 

 

7 thoughts on “Change MAC Address with PowerShell of a Wireless Adapter”

  1. Please note that the “” got screwed up with the font here. So don’t copy and paste from the comment section, do the change manually in your script or you will get some problems.

  2. Just enter the MAC you would like to use on line 02 like this;

    function random-mac {
    $mac = “02BBBBBB”
    while ($mac.length -lt 12)
    {
    $mac += “{0:X}” -f $(get-random -min 0 -max 16)
    }

    $Delimiter = “-”
    for ($i = 0 ; $i -le 10 ; $i += 2)
    { $newmac += $mac.substring($i,2) + $Delimiter }
    $setmac = $newmac.substring(0,$($newmac.length – $Delimiter.length))
    $setmac
    }

    It will add the XX XX random numbers on top of that.

  3. Thanks. Thats pretty cool. I want to use this to define a more specific range of mac addresses that I can pre-authorize during a PXE build process. So I’d like to pick from a pool starting with 02-BB-BB-BB-XX-XX . (x’s obviously being the randomized chars) How would I do that ?

  4. I will add a feature to revert back to the original address.

  5. How do you retrieve your original MAC after you use the script ?

    Do you know an easy way to run the script automatically each XX minutes, like at a coffee shop where the Internet limit is 15 minutes, having it to change MAC each 13 minutes would be useful 😉

    Regards !

Leave a Reply