Netsh 移動寬頻網路命令

適用於:Windows Server 2022、Windows Server 2019、Windows Server 2016、Azure Stack HCI 21H2 和 20H2 版本

您可以使用netsh mbn來查詢和設置移動寬頻網路(MBN)的設置和參數。

提示

您可以透過使用netsh mbn命令來獲取幫助。

netsh mbn /?

可用的 netsh mbn 命令如下:

add

將組態項目新增到資料表。

可用的netsh mbn add命令包括:

dmprofile

在設定檔資料存放區中新增 DM 組態設定檔。

語法

add dmprofile [interface=]<string> [name=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
name 設定檔 XML 檔案的名稱。 是包含設置資料數據的 XML 資料的名稱。 必要

範例

add dmprofile interface="Cellular" name="Profile1.xml"

profile

在設定檔資料存放區中新增網路設定檔。

語法

add profile [interface=]<string> [name=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
name 設定檔 XML 檔案的名稱。 是包含設置資料數據的 XML 資料的名稱。 必要

範例

add profile interface="Cellular" name="Profile1.xml"

連線

連線到行動寬頻網路。

語法

connect [interface=]<string> [connmode=]tmp|name [name=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
connmode 指定連線參數的提供方式。 您可以使用設置檔 XML 或先前使用該命令儲存在行動寬頻設置檔資料儲存中的設置檔 XML 的設置檔名稱來netsh mbn add profile請求連線。 在上一個例子中,參數應保持tmp為值。 而在下來的name例子中 必要
name 設定檔 XML 檔案的名稱。 是包含設置資料數據的 XML 資料的名稱。 必要

範例

connect interface="Cellular" connmode=tmp name=d:\profile.xml
connect interface="Cellular" connmode=name name=MyProfileName

delete

刪除資料表中的組態項目。

可用的netsh mbn delete命令有:

dmprofile

刪除設定檔資料存放區中的 DM 組態設定檔。

語法

delete dmprofile [interface=]<string> [name=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
name 設定檔 XML 檔案的名稱。 是包含設置資料數據的 XML 資料的名稱。 必要

範例

delete dmprofile interface="Cellular" name="myProfileName"

profile

刪除設定檔資料存放區中的網路設定檔。

語法

delete profile [interface=]<string> [name=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
name 設定檔 XML 檔案的名稱。 是包含設置資料數據的 XML 資料的名稱。 必要

範例

delete profile interface="Cellular" name="myProfileName"

diagnose

執行基本行動電話問題的診斷。

語法

diagnose [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

diagnose interface="Cellular"

中斷連線

中斷與行動寬頻網路的連線。

語法

disconnect [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

disconnect interface="Cellular"

dump

顯示組態指令碼。

建立包含目前組態的設定檔。 如果儲存到檔案中,此指令碼即可用來還原已變更的組態設定。

語法

dump

說明

顯示命令清單。

語法

help

set

設定組態資訊。

可用的 netsh mbn set 命令如下:

acstate

針對指定的介面設定行動寬頻資料自動連線狀態。

語法

set acstate [interface=]<string> [state=]autooff|autoon|manualoff|manualon

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
name 要設定的自動連線狀態。 下列其中一個值:
autooff:自動連線標誌關閉。
autoon:自動連線標誌開啟。
manualoff:手動連線標誌關閉。
manualon:手動連線標誌開啟。
必要

範例

set acstate interface="Cellular" state=autoon

dataenablement

針對指定的設定檔集和介面,開啟或關閉行動寬頻資料。

語法

set dataenablement [interface=]<string> [profileset=]internet|mms|all [mode=]yes|no

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
profileset 設定檔集的名稱。 必要
mode 下列其中一個值:
yes:啟用目標設置檔集。
no:停用目標設置檔集。
必要

範例

set dataenablement interface="Cellular" profileset=mms mode=yes

dataroamcontrol

針對指定的設定檔集和介面,設定行動寬頻資料漫遊控制。

語法

set dataroamcontrol [interface=]<string> [profileset=]internet|mms|all [state=]none|partner|all

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
profileset 設定檔集的名稱。 必要
mode 下列其中一個值:
none:僅限國內業者。
partner:僅限國內業者及合作夥伴。
all:僅限國內業者、合作夥伴及漫遊。
必要

範例

set dataroamcontrol interface="Cellular" profileset=mms mode=partner

enterpriseapnparams

針對指定的介面設定行動寬頻資料 enterpriseAPN 參數。

語法

set enterpriseapnparams [interface=]<string> [allowusercontrol=]yes|no|nc [allowuserview=]yes|no|nc [profileaction=]add|delete|modify|nc

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
allowusercontrol 下列其中一個值:
yes:允許使用者控制企業 APN。
no:不允許使用者控制企業 APN。
nc:沒有變更。
必要
allowuserview 下列其中一個值:
yes:允許使用者查閱企業 APN。
no:不允許使用者查閱企業 APN。
nc:沒有變更。
必要
profileaction 下列其中一個值:
add:新增企業 APN 資料。
delete:刪除企業 APN 資料。
modify:修改企業 APN 資料。
nc:沒有變更。
必要

範例

set enterpriseapnparams interface="Cellular" profileset=mms mode=yes

highestconncategory

設置指定介面的 Mobile Broadband 數據的最高連接類別。

語法

set highestconncategory [interface=]<string> [highestcc=]admim|user|operator|device

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
highestcc 下列其中一個值:
admin:管理員設置的個人資料。
user:使用者設置的個人資料。
operator:開發人員設置的個人資料。
device:設備設置的個人資料。
必要

範例

set highestconncategory interface="Cellular" highestcc=operator

powerstate

針對指定的介面開啟或關閉行動寬頻無線電。

語法

set powerstate [interface=]<string> [state=]on|off

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
state 下列其中一個值:
on:開啟無線電收發器電源。
off:關閉無線電收發器電源。
必要

範例

set powerstate interface="Cellular" state=on

profileparameter

在行動寬頻網路設定檔中設定參數。

語法

set profileparameter [name=]<string> [[interface=]<string>] [[cost]=default|unrestricted|fixed|variable]

參數

參數 描述 需求
name 要修改的設定檔名稱。 如果指定了介面,則只會修改該介面上的資料。 必要
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 選擇性
cost 與設定檔相關聯的成本。 選擇性

備註

必須在介面名稱和成本之間至少指定一個參數。

範例

set profileparameter name="profile 1" cost=default

slotmapping

針對指定的介面設定行動寬頻數據機插槽對應。

語法

set slotmapping [interface=]<string> [slotindex=]<integer>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
slotindex 要設定的插槽索引。 必要

範例

set slotmapping interface="Cellular" slotindex=1

tracing

啟用或停用追蹤。

語法

set tracing [mode=]yes|no

參數

參數 描述 需求
mode 下列其中一個值:
yes:啟用 Mobile Broadband 追蹤。
no:停用 Mobile Broadband 追蹤。
必要

範例

set tracing mode=yes

show

顯示行動寬頻網路資訊。

可用的 netsh mbn show 命令如下:

acstate

針對指定的介面顯示行動寬頻資料自動連線狀態。

語法

show acstate [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show acstate interface="Cellular"

capability

針對指定的介面顯示介面功能資訊。

語法

show capability [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show capability interface="Cellular"

connection

針對指定的介面顯示目前連線資訊。

語法

show connection [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show connection interface="Cellular"

dataenablement

針對指定的介面顯示行動寬頻資料啟用狀態。

語法

show dataenablement [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show dataenablement interface="Cellular"

dataroamcontrol

針對指定的介面顯示行動寬頻資料漫遊控制狀態。

語法

show dataroamcontrol [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show dataroamcontrol interface="Cellular"

dmprofiles

顯示系統上設定的 DM 組態設定檔清單。

語法

show dmprofiles [[name=]<string>] [[interface=]<string>]

參數

參數 描述 需求
name 要顯示的設定檔名稱。 選擇性
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 選擇性

備註

顯示設定檔資料,或列出系統上的設定檔。

如果提供設置資料名稱,則顯示該資料的內容。 否則將列出介面的資料。

如果提供了介面名稱,則僅列出指定介面上的資料。 否則,將顯示第一個匹配的設置資料。

範例

show dmprofiles name="profile 1" interface="Cellular"
show dmprofiles name="profile 2"
show dmprofiles

enterpriseapnparams

針對指定的介面顯示行動寬頻資料 enterpriseAPN 參數。

語法

show enterpriseapnparams [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show enterpriseapnparams interface="Cellular"

highestconncategory

針對指定的介面顯示行動頻寬資料最高連線類別。

語法

show highestconncategory [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show highestconncategory interface="Cellular"

homeprovider

針對指定的介面顯示家用提供者資訊。

語法

show homeprovider [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show homeprovider interface="Cellular"

interfaces

顯示系統上的行動寬頻介面清單。 這個命令沒有參數。

語法

show interfaces

netlteattachinfo

針對指定的介面顯示行動寬頻網路 LTE 連結資訊。

語法

show netlteattachinfo [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show netlteattachinfo interface="Cellular"

pin

針對指定的介面顯示 pin 資訊。

語法

show pin [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show pin interface="Cellular"

pinlist

針對指定的介面顯示 pin 清單資訊。

語法

show pinlist [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show pinlist interface="Cellular"

preferredproviders

針對指定的介面顯示慣用提供者清單。

語法

show preferredproviders [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show preferredproviders interface="Cellular"

設定檔

顯示系統上設定的設定檔清單。

語法

show profiles [[name=]<string>] [[interface=]<string>] [[purpose=]<string>]

參數

參數 描述 需求
name 要顯示的設定檔名稱。 選擇性
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 選擇性
purpose 目的 選擇性

備註

如果提供設置資料名稱,則顯示該資料的內容。 否則將列出介面的資料。

如果提供了介面名稱,則只會列出指定介面上的指定資料。 否則,將顯示第一個匹配的設置資料。

如果提供了目的地,則僅顯示具有匹配目的地 GUID 的資料。 否則,資料將不會依指示進行篩選。 字串可以是具有大括弧或下列其中一個字串的 GUID:internet、supl、mms、ims 或 allhost。

範例

show profiles interface="Cellular" purpose="{00000000-0000-0000-0000-000000000000}"
show profiles name="profile 1" interface="Cellular"
show profiles name="profile 2"
show profiles

profilestate

針對指定的介面顯示行動寬頻設定檔狀態。

語法

show profilestate [interface=]<string> [name=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要
name 設定檔的名稱。 具有要顯示的狀態的資料的名稱。 必要

範例

show profilestate interface="Cellular" name="myProfileName"

provisionedcontexts

針對指定的介面顯示佈建的內容資訊。

語法

show provisionedcontexts [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show provisionedcontexts interface="Cellular"

purpose

顯示可用來篩選裝置上設定檔的目的群組 GUID。 這個命令沒有參數。

語法

show purpose

radio

針對指定的介面顯示無線電狀態資訊。

語法

show radio [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show radio interface="Cellular"

readyinfo

針對指定的介面顯示就緒資訊。

語法

show readyinfo [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show readyinfo interface="Cellular"

signal

針對指定的介面顯示訊號資訊。

語法

show signal [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show signal interface="Cellular"

slotmapping

針對指定的介面顯示行動寬頻數據機插槽對應。

語法

show slotmapping [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show slotmapping interface="Cellular"

slotstatus

針對指定的介面顯示行動寬頻數據機插槽狀態。

語法

show slotstatus [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show slotstatus interface="Cellular"

smsconfig

針對指定的介面顯示簡訊 (SMS) 組態資訊。

語法

show smsconfig [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show smsconfig interface="Cellular"

tracing

顯示行動寬頻追蹤已啟用或已停用。

語法

show tracing

visibleproviders

針對指定的介面顯示可見提供者清單。

語法

show visibleproviders [interface=]<string>

參數

參數 描述 需求
interface 介面名稱。 是命令顯示的netsh mbn show interfaces名稱之一。 必要

範例

show visibleproviders interface="Cellular"

測試

在收集記錄時,執行特定功能區域的測試。

語法

test [feature=<feature area>] [testPath=<path>] [taefPath=<path>] [param=<test input params>]

參數

標籤 是否可選擇?
功能 以下備註部分為支援功能區網域以外的功能區網域 必要
testpath 包含測試二進位檔的路徑 如果已安裝 HLK 伺服器,則為選擇性
taefpath 包含 TAEF 二進位檔的路徑 如果已安裝 HLK 伺服器,則為選擇性
param 以逗號分隔的參數,用於測試 對於特定功能區為必要性,對於其他功能區為選擇性

備註

支援的功能區為:

  • 連線能力
  • power
  • radio
  • esim
  • sms
  • dssa
  • lte
  • bringup

有些測試需要現場提供更多param參數。 以下是功能所需的必要參數:

  • 連結性:AccessString、使用者名稱(如果適用)、密碼(如果適用)
  • 無線通訊:AccessString、使用者名稱(如果適用)、密碼(如果適用)
  • 網卡: ActivationCode
  • bringup:AccessString、使用者名稱(如果適用)、密碼(如果適用)

範例

test feature=connectivity param="AccessString=internet"
test feature=lte testpath="C:\\data\\test\\bin" taefpath="C:\\data\\test\\bin"
test feature=lte