Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Getting Serial Number of Computer

Reply
 
Old 08-14-2007   #1 (permalink)
greatbarrier86


 
 

Getting Serial Number of Computer

Hi,

I apologize for being a pest, but is it possible, ideally through
powershell, or through VBS, to get the serial number of a computer? I need to
get it as a variable then write it to a file. Is this possible to do in
powershell?

My System SpecsSystem Spec
Old 08-14-2007   #2 (permalink)
phyler


 
 

RE: Getting Serial Number of Computer

As in the serial number for the hardware? Or are you talking about the
Windows license code?

I have used the "get-wmiobject win32_bios" to get the serial number for the
hardware on my Dell boxes.

I'm not sure if that is what you are looking for or not.

"greatbarrier86" wrote:

> Hi,
>
> I apologize for being a pest, but is it possible, ideally through
> powershell, or through VBS, to get the serial number of a computer? I need to
> get it as a variable then write it to a file. Is this possible to do in
> powershell?

My System SpecsSystem Spec
Old 08-14-2007   #3 (permalink)
Hal Rottenberg


 
 

Re: Getting Serial Number of Computer

On Aug 14, 1:36 pm, greatbarrier86
<greatbarrie...@discussions.microsoft.com> wrote:
> I apologize for being a pest, but is it possible, ideally through
> powershell, or through VBS, to get the serial number of a computer? I need to
> get it as a variable then write it to a file. Is this possible to do in
> powershell?


Oh, an easy one!

65# $baseboard = Get-WmiObject Win32_BaseBoard
66# $baseboard.SerialNumber
..7B530C1.CN1296169KB591.

My System SpecsSystem Spec
Old 08-14-2007   #4 (permalink)
Hal Rottenberg


 
 

Re: Getting Serial Number of Computer

On Aug 14, 1:47 pm, Hal Rottenberg <halr9...@gmail.com> wrote:
> 65# $baseboard = Get-WmiObject Win32_BaseBoard
> 66# $baseboard.SerialNumber
> .7B530C1.CN1296169KB591.


And to a file:

69# $baseboard.SerialNumber | set-content sn.txt
70# get-content C:\tmp\sn.txt
..7B530C1.CN1296169KB591.

My System SpecsSystem Spec
Old 08-14-2007   #5 (permalink)
Hal Rottenberg


 
 

Re: Getting Serial Number of Computer

On Aug 14, 1:46 pm, phyler <phy...@discussions.microsoft.com> wrote:
> I have used the "get-wmiobject win32_bios" to get the serial number for the
> hardware on my Dell boxes.


Here's the difference in the two on my laptop:

71# gwmi win32_bios

SMBIOSBIOSVersion : A08
Manufacturer : Dell Inc.
Name : Phoenix ROM BIOS PLUS Version 1.10 A08
SerialNumber : 7B530C1
Version : DELL - 27d70403

72# gwmi win32_baseboard

Manufacturer : Dell Inc.
Model :
Name : Base Board
SerialNumber : .7B530C1.CN1296169KB591.
SKU :
Product : 0JK187

My System SpecsSystem Spec
Old 08-14-2007   #6 (permalink)
greatbarrier86


 
 

Re: Getting Serial Number of Computer

Damn! very nice. This is the computer's serial number correct? The HP
assigned serial?

"Hal Rottenberg" wrote:

> On Aug 14, 1:47 pm, Hal Rottenberg <halr9...@gmail.com> wrote:
> > 65# $baseboard = Get-WmiObject Win32_BaseBoard
> > 66# $baseboard.SerialNumber
> > .7B530C1.CN1296169KB591.

>
> And to a file:
>
> 69# $baseboard.SerialNumber | set-content sn.txt
> 70# get-content C:\tmp\sn.txt
> ..7B530C1.CN1296169KB591.
>
>

My System SpecsSystem Spec
Old 08-14-2007   #7 (permalink)
greatbarrier86


 
 

Re: Getting Serial Number of Computer

Damn! very nice. This is the computer's serial number correct? The HP
assigned serial?

"Hal Rottenberg" wrote:

> On Aug 14, 1:47 pm, Hal Rottenberg <halr9...@gmail.com> wrote:
> > 65# $baseboard = Get-WmiObject Win32_BaseBoard
> > 66# $baseboard.SerialNumber
> > .7B530C1.CN1296169KB591.

>
> And to a file:
>
> 69# $baseboard.SerialNumber | set-content sn.txt
> 70# get-content C:\tmp\sn.txt
> ..7B530C1.CN1296169KB591.
>
>

My System SpecsSystem Spec
Old 08-14-2007   #8 (permalink)
Hal Rottenberg


 
 

Re: Getting Serial Number of Computer

On Aug 14, 2:24 pm, greatbarrier86
<greatbarrie...@discussions.microsoft.com> wrote:
> Damn! very nice. This is the computer's serial number correct? The HP
> assigned serial?


This one is a Dell, but yeah.

You should do some reading on WMI. There is a ton of good stuff in
there, and it's incredibly easy to get at using Powershell.

Here's more info on WMI classes that have hardware info:

http://msdn2.microsoft.com/en-us/lib...d_port_classes

And the WMI homepage on MSDN:

http://msdn2.microsoft.com/en-us/library/aa394582.aspx

Then of course in Powershell,

# help get-wmiobject -detailed

And a Script Center article:

http://www.microsoft.com/technet/scr...mshandwmi.mspx

My System SpecsSystem Spec
Old 08-14-2007   #9 (permalink)
greatbarrier86


 
 

Re: Getting Serial Number of Computer

I got it and 3 other wmi ones that i have been needing...those queries are
REALLY easy.

"Hal Rottenberg" wrote:

> On Aug 14, 2:24 pm, greatbarrier86
> <greatbarrie...@discussions.microsoft.com> wrote:
> > Damn! very nice. This is the computer's serial number correct? The HP
> > assigned serial?

>
> This one is a Dell, but yeah.
>
> You should do some reading on WMI. There is a ton of good stuff in
> there, and it's incredibly easy to get at using Powershell.
>
> Here's more info on WMI classes that have hardware info:
>
> http://msdn2.microsoft.com/en-us/lib...d_port_classes
>
> And the WMI homepage on MSDN:
>
> http://msdn2.microsoft.com/en-us/library/aa394582.aspx
>
> Then of course in Powershell,
>
> # help get-wmiobject -detailed
>
> And a Script Center article:
>
> http://www.microsoft.com/technet/scr...mshandwmi.mspx
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Serial Number Vista security
Volume serial number PowerShell
serial number Vista installation & setup
Installing without a Serial Number Vista installation & setup
What should be used for the serial number? Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46