Martins ConfigMgr stuff

Random stuff about ConfigMgr (SCCM).

Get computer serial number and other info with PowerShell

Get computer serial number and other info with PowerShell

  • Comments 11
  • Likes

To get the serial number from a computer run the following PowerShell command:

gwmi win32_bios | fl SerialNumber

To get more information e.g. bios version and manufacturer just run:

gwmi win32_bios

Comments
  • very helpful

  • Helpful indeed

  • How do you do this for a computer over the network?

  • You can use Invoke-Command.
    E.g. Invoke-Command -ComputerName DC1 {Get-WmiObject win32_bios}

  • Or Get-WMIObject -Class Win32_BIOS -ComputerName DC1 | Format-List SerialNumber

  • How you do this if you do not know all the computer names in a domain environment?

  • Get-WmiObject -ComputerName myserver.corp.local -Class Win32_BIOS

  • how can i find a Serialnummer in my domain.
    I have onla the seriennummer (hardware)
    thx

  • georg do you have some kind of inventory system like SCCM? Then you can query it for the serial number.

  • If I wanted to then pass this to a variable in a script how would i go about that?

  • If you want to store it as a variable just do something like:
    $SN = gwmi win32_bios | Select-Object SerialNumber
    or if you just want to store the value:
    $SN = gwmi win32_bios | Select –ExpandProperty SerialNumber

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment