PowerShell grab the computer serial number

Original link: http://www.cnblogs.com/wangfei1248/p/9728007.html

For companies which Windows computers (99%) installed to manage the computer's factory serial number (Serial Number, also called service number -Service Number) is.

This number is used for computer asset management is useful, it can be said in the asset table is an indispensable key, because it has the following characteristics:

  1. There on the factory label, in general, very solid and reliable, is not easy to wear.
  2. Motherboard BIOS there may query or crawl through the system.
  3. For the same brand of machine, number is globally unique.
  4. Manufacturers can be found in the official website, look for warranty service through the official website, look for driver software, troubleshooting, what are the lingua franca.

 

How to get the serial number it, climbed up the host copy? Reboot into the BIOS to view the information?

It can be, but a simpler method may be on a computer running the command from the command line:

  wmic bios get serialnumber

  You can easily grab the serial number of the machine.

  PowerShell is a more powerful tool, the above requirements can easily be achieved by PowerShell:

  Get-WmiObject -class win32_bios | Select-Object SerialNumber

 

For remote computer how to do it?

Can execute the following command in PowerShell:

 Get-WmiObject -ComputerName $ComputerName -Class Win32_BIOS

 Of which $ ComputerName is the name of the remote computer, provided that the successful implementation of the current user must have administrative rights on the remote computer, such as a domain administrator.

 

Windows PowerShell stuff found on the system administrator is a very useful again, and then try these words:

$ComputerName = $env:COMPUTERNAME
$serial = (Get-WmiObject -ComputerName $ComputerName -Class Win32_BIOS).SerialNumber
"Your computer serial is $serial"

Reproduced in: https: //www.cnblogs.com/wangfei1248/p/9728007.html

Guess you like

Origin blog.csdn.net/weixin_30438813/article/details/94817955