0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

物理デバイスだけの一覧を取得した…かった話

0
Posted at

概要

Windowsにてパラメーターシートに載せるため、接続されている物理デバイスの一覧をPowershellで取得しようと頑張った話です。

結論

ダメでした。

環境

  • オンプレサーバ
  • WorkGroup
  • Windows Server 2022 Standard

調べたもの

  • Get-PnpDeviceコマンド

  • Win32_PnPEntity

  • デバイスツリー

まとめたもの

  1. Get-PnpDeviceはいくつかのオプションがあるけど、物理デバイスのみをだすオプションはない
    • オンラインのデバイスを出すオプション
    • ClassやInstanceIdでフィルタするオプション
    • ステータスでフィルタするオプション
  2. Windowsがデバイスを参照するときに見てるのはデバイスそのものではない
    • Windowsはdevnodeってのに入れて管理している
    • 参照するときはdevnodeから見てる
    • devnodeに物理デバイスも仮想デバイスを分けて考える属性がない
      • 明言はされてないけど、実際コマンドの結果そう見える

以上のため、物理デバイスと仮想デバイスはWindowsの公式機能では分けられないみたいです。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?