none
Script for WAN network adapter Advanced settings RRS feed

  • Question

  • Hello Team,

    Could you please help me with a script that could give the advanced settings for the wifi adapters.

    The below is the screenshot for better understanding....

    in the below format

    802.22h+d Loose 11h
    802.11n Preamable Mixed Mode
    AP Compatibility Mode

    Higher Performance

    Regards,

    Suman Rout

    • Moved by Bill_Stewart Thursday, December 31, 2015 5:19 PM This is not "research and design solution for me" forum
    Tuesday, November 24, 2015 7:30 PM

All replies

  • The settings will be under this key.  You will have to search through all entries to find your card.

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}


    \_(ツ)_/

    Tuesday, November 24, 2015 7:54 PM
  • Something like this (might need to change the parameters or values being set);

    ############################################################
    # Script to change Wireless Settings for Lenovo laptops to
    # match recommendations by the Networking team
    ############################################################

    # Determine if it is a Lenovo laptop. If not, exit script.
    if ((Get-WmiObject Win32_Computersystem).Manufacturer -notlike "Lenovo") { Exit }

    # Narrow search scope to speed up results
    $keys = Get-ChildItem HKLM:\SYSTEM\CurrentControlSet\Control\Class -Recurse -ErrorAction SilentlyContinue

    # Generate correct path for Wireless Adapter registry entries regardless of model
    $hkPath = $null
    ForEach ($key in $keys)
    {
        $WirelessModeKey = Get-ItemProperty -Path $Key.PSPath | Where {$_.WirelessMode -ne $null}
           
        If ($WirelessModeKey -ne $null)
        {
            $hkPath = $WirelessModeKey.PsPath
            # Change Registry Values
            Set-ItemProperty -Path $hkPath -Name RoamingPreferredBandType -Value 1
            Set-ItemProperty -Path $hkPath -Name RoamAggressiveness -Value 0
            Set-ItemProperty -Path $hkPath -Name WirelessMode -Value 32
            Set-ItemProperty -Path $hkPath -Name PnPCapabilities -Value 24

        }
    }

    # Reboot workstation to have settings apply and restore SCCM client functionality.
    shutdown -r -t 300 -f -c "Rebooting workstation in 5 minutes to reset wireless NIC settings..."

    Jack

    Tuesday, November 24, 2015 8:31 PM
  • Hi Mike,

    I have been struggling to find out the ways to get the currently set wifi adapter advanced settings. We want to get the current settings and analyse them and change them if require.

    I have found many blogs that says that we can change the settings via the registry settings, but my concern is that can I get the current settings as mentioned in the above mentioned format.

    I have tried a lot using wmi query and powershell but could not get it.

    If you through some light on the same I will be great-full to you.

    Regards,

    Suman Rout

    Wednesday, November 25, 2015 5:52 AM
  • There is no method for getting th setting via WMI unless the vendor of the hardware provides a custom WMI class.

    The above posts show you where in the registry to look for the adapter settings.  It will be different for every adapter model.

    The following code will find all wireless adapters.

    Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}'|
    	Where{$_.GetValue('WirelessMode')}
    
    
    


    \_(ツ)_/

    Wednesday, November 25, 2015 6:10 AM
  • Hello Team,

    I need a batch file that could help me to read the registry value and write the outcome to a text file.

    The below is the code I have:

    @echo off
    set file=c:\regcomplist.txt
    for /f "Tokens=*" %%g in (%file%) do (
    echo %%g>> c:\regquery.txt
    reg query "\\%%g\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0011" /v IEEE11nMode">> c:\regquery.txt
    echo.>> c:\regquery.txt
    )

    But this is not working and on screen shows error as network path not found. Please help me in correcting this script.

    Regards,

    Suman Rout

    • Merged by Bill_Stewart Wednesday, December 2, 2015 1:20 PM Duplicate
    Wednesday, December 2, 2015 12:45 PM
  • It won't work if the registry service is not running and the firewall is not open.  It will also not work if the key does not exist.

    \_(ツ)_/

    Wednesday, December 2, 2015 1:17 PM
  • Hi  jrv,

    Is there any other way to get it,

    and "registry service" did you mean "remote registry service"??

    somebody updated me that this was possible earlier by vbscript but we are unable to find the same....

    Regards,

    Suman Rout

    Thursday, December 3, 2015 7:01 AM
  • The scripting language has nothing to do with it.  If the remote registry service isnot running and/or the firewall is not open you cannot get access remotely.

    You can do this with the WMI registry provider.  Look  for examples of using the registry provider for WMI with PowerShell.


    \_(ツ)_/

    Thursday, December 3, 2015 7:05 AM