The script executes without any errors but when i go check the specific adapter i'm targeting its settings haven't changed from their default of obtaining the dns automatically. I don't need to change any other setting except for the DNS Server addresses. I've checked the $wmi object above and i verified it is the adapter i want to be changed. I also tried to pass in a static string to SetDNSServerSearchOrder ($wmi.SetDNSServerSearchOrder("126.96.36.199")) but that didn't work either. I'm not running the script as administrator and i'm assuming thats ok since i didn't receive any errors when running the script. This probably doesn't matter but this script is running on Windows 10 Fall Creators Update. Any help would be appreciated.
There is a #requires you can add to the top of your script so that it will produce an error if you are not running as an admin. I have to use this every once in a while so that I remember months later.