New to the forum with a question

Hello, I am trying to figure out how to create a powershell script that will run this command (netsh wlan show interfaces). If the radio type is set to “ax” I want to change it to “ac” or “n”. If anyone knows the best way to achieve this and would share I would be very grateful. Thank you

Welcome to the forum. :wave:t4:

This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

We actually expect you to make an own attempt at the first place to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

Regardless of that …

Isn’t that a property of the hardware and cannot be changed?

1 Like

That netsh command shows you the connection that’s currently negotiated. If you want to change that, you’ll have to force one of the other protocols. That’s best done with native PowerShell:

if ( (Get-NetAdapterAdvancedProperty -Name WiFi -RegistryKeyword IEEE11nMode).RegistryValue -eq 3 ) {
    Set-NetAdapterAdvancedProperty -Name Wifi -RegistryKeyword IEEE11nMode -RegistryValue 2

3 - 802.11ax
2 - 802.11ac
1 - 802.11n

Note: this will probably disconnect the WiFi.

1 Like

Very neat. :+1:t4:

Just out of couriousity …

I never had to mess with those settings in any environmment so far: Shouldn’t be each newer version backwards compatible anyway? Why would one force an older version?

Yes, I’m not really sure what op is trying to achieve.

Mine’s set to 3 but negotiates as 802.11ac because the AP doesn’t support 802.11ax. If I was op, I would leave it as the highest and let the NIC and AP argue it out.

1 Like

That’s what I thought. Thanks. :+1:t4: