VBScript – A network adapters properties(MSFT_NetAdapter)

Facebooktwittermail

先日、VBScriptでWin32_NetworkAdapter classを使用してネットワークアダプタ情報を取得するサンプルプログラムを記載しました。

VBScript – A network adapters properties(Win32_NetworkAdapter)

ただ下記サイトにはWin32_NetworkAdapter classは廃止予定でMSFT_NetAdapter classを利用するように記載されています。
Win32_NetworkAdapter class
https://msdn.microsoft.com/library/windows/hardware/aa394216

The Win32_NetworkAdapter class is deprecated. Use the MSFT_NetAdapter class instead.

そこでMSFT_NetAdapter classを利用したサンプルプログラムも作成してみました。
MSFT_NetAdapter class
https://msdn.microsoft.com/ja-jp/library/windows/hardware/hh968170

Windows 10 Pro(Build 15063)で確認しました。
表示するプロパティは適当にピックアップしたものでこれと言った意図はありません。またInterfaceType=6で有線LANだけを表示するようにしています。

出力結果です。


InterfaceTypeについてはIANAでの定義に沿っているようです。

InterfaceType
Data type: uint32
Access type: Read-only
The interface type as defined by the Internet Assigned Names Authority (IANA).

ここでいいのかな。
https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib

有線LAN(InterfaceType=6),無線LAN(InterfaceType=71)ぐらい覚えておけばよさそうです。
Bluetoothネットワーク接続がInterfaceType=6だったのは意外です。

Leave a Reply