0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PowerShellでシステム情報取得

Last updated at Posted at 2025-05-02

システム情報取得

・マシン名
・シリアル番号(製造番号)
・システムモデル名
・MACアドレス
を取得して表示する。

※実行前に以下で実行権限を与えておくこと

Set-ExecutionPolicy RemoteSigned

右クリック -> [PowerShellで実行]を選択して実行

コード

getSystemInfo.ps1
chcp 437
cls

$hostname = hostname
Write-Host("Computer Name : {0}" -f $hostname)

$serialNumber = (wmic bios get serialnumber | Select-Object -Skip 1)[1].Trim()
Write-Host("Serial Number : {0}" -f $serialNumber)

$systemModel = (systeminfo | findstr /C:"System Model:") -replace "System Model:\s+", ""
Write-Host("System Model  : {0}" -f $systemModel)

$physicalAddress = (netsh wlan show interfaces | find "Physical address") -replace "\s+Physical address\s+:\s", ""
Write-Host("MAC address   : {0}" -f $physicalAddress)

pause
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?