Мы периодически наблюдаем проблемы с подключением пользователей к Wi-Fi. It seems that this may be due to interference, with the recommended solution being to change the RoamingPreferredBandType to 5GHz.
Per this thread, this can be done by amending the registry setting RoamingPreferredBandType's value to 2. Some code (for both bat
and powershell
have been included on that thread; but these seem to scan through a large chunk of the registry finding and updating all properties with this value. Whilst it's pretty unlikely that other entries will have a property with this name, I don't like code that works on assumptions; and this approach isn't overly efficient. Is there a better way to do this, targeting only those entries that matter?
Это измененная версия сценария в ветке форума Intel (ссылка на которую приведена в вопросе), которая использует несколько преимуществ для улучшения своего сценария:
{4D36E972-E325-11CE-BFC1-08002BE10318}
всегда будет тот, под которым будут находиться сетевые адаптеры, что поможет нам сузить путь к реестру: https://technet.microsoft.com/en -us / library / jj130901.aspx Win32_NetworkAdapter
, который в сочетании с приведенным выше дает нам полный путь к разделу реестра нашего адаптера. . .
Get-WmiObject -Class Win32_NetworkAdapter | ?{$_.Name -like '*Wireless*'} | %{("HKLM:\SYSTEM\CurrentControlSet\Control\Class\{{4D36E972-E325-11CE-BFC1-08002BE10318}}\{0:0000}" -f ([int]$_.Index))} | %{
if(get-itemproperty -Path $_ -Name 'RoamingPreferredBandType' -ErrorAction SilentlyContinue) {
Set-ItemProperty -Path $_ -Name 'RoamingPreferredBandType' -Value 2
} else {
New-ItemProperty -Path $_ -Name 'RoamingPreferredBandType' -PropertyType String -Value 2
}
}
т.е.