Jump to content

Script to retrieve PC's serial numbers and names


Recommended Posts

Guest Donny
Posted

I would like to retrieve all of our network's PC's serial numbers and PC

names and output it into a spreadsheet. Does anyone have any idea how this

can be done? I've also a list of all the PC names so is there a way to read

these names and output the serial together with the name to a file?

  • Replies 5
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: Script to retrieve PC's serial numbers and names

 

 

"Donny" <donny@joho.com> wrote in message

news:FAC2E8FC-3C33-4072-AA57-D20BAFC5885F@microsoft.com...

>I would like to retrieve all of our network's PC's serial numbers and PC

> names and output it into a spreadsheet. Does anyone have any idea how this

> can be done? I've also a list of all the PC names so is there a way to

> read

> these names and output the serial together with the name to a file?

 

What serial number are you referring to? Where do you see it?

Guest Donny
Posted

Re: Script to retrieve PC's serial numbers and names

 

The serial number from the BIOS. I need to read from a list of computer names

on the network and then retrieve the S/N's from them

 

"Pegasus (MVP)" wrote:

>

> "Donny" <donny@joho.com> wrote in message

> news:FAC2E8FC-3C33-4072-AA57-D20BAFC5885F@microsoft.com...

> >I would like to retrieve all of our network's PC's serial numbers and PC

> > names and output it into a spreadsheet. Does anyone have any idea how this

> > can be done? I've also a list of all the PC names so is there a way to

> > read

> > these names and output the serial together with the name to a file?

>

> What serial number are you referring to? Where do you see it?

>

>

>

Guest Pegasus \(MVP\)
Posted

Re: Script to retrieve PC's serial numbers and names

 

If you have few PCs then the quickest method would be to collect

these numbers manually. If you have many PCs then it is very

unlikely that all of them would on-line at the same time. A more

effective strategy would be to insert the code below into the

logon script and let each PC report its serial number when it

goes on-line.

 

01. @echo off

02. set LogFile=\\SomeServer\SerialAudit\%ComputerName%.txt

03. if exist %LogFile% goto :eof

04. echo > c:\TempVBS.vbs Set objNetwork = CreateObject("Wscript.Network")

05. echo >> c:\TempVBS.vbs strComputer = objNetwork.ComputerName

06. echo >> c:\TempVBS.vbs Set BIOSSet =

GetObject("winmgmts:{impersonationLevel=impersonate}!//" _

07. echo >> c:\TempVBS.vbs ^& "./root/cimv2").ExecQuery("select

SerialNumber from Win32_BIOS")

08. echo >> c:\TempVBS.vbs For Each BIOS In BIOSSet

09. echo >> c:\TempVBS.vbs wscript.echo ComputerName & " " &

BIOS.SerialNumber

10. echo >> c:\TempVBS.vbs Next

11. cscript //nologo c:\TempVBS.vbs > %LogFile%

12. del c:\TempVBS.vbs

 

Instructions:

- Create a suitable share on your server.

- Adjust Line #02 accordingly.

- Remove the line numbers.

- Try the script.

 

 

"Donny" <donny@joho.com> wrote in message

news:FC390127-ECC6-48FE-9605-B6337855A061@microsoft.com...

> The serial number from the BIOS. I need to read from a list of computer

> names

> on the network and then retrieve the S/N's from them

>

> "Pegasus (MVP)" wrote:

>

>>

>> "Donny" <donny@joho.com> wrote in message

>> news:FAC2E8FC-3C33-4072-AA57-D20BAFC5885F@microsoft.com...

>> >I would like to retrieve all of our network's PC's serial numbers and PC

>> > names and output it into a spreadsheet. Does anyone have any idea how

>> > this

>> > can be done? I've also a list of all the PC names so is there a way to

>> > read

>> > these names and output the serial together with the name to a file?

>>

>> What serial number are you referring to? Where do you see it?

>>

>>

>>

Guest Bruce Chambers
Posted

Re: Script to retrieve PC's serial numbers and names

 

Donny wrote:

> I would like to retrieve all of our network's PC's serial numbers...

 

 

How are you expecting a script to look at the outside of the computers'

cases to read the serial numbers?

 

> and PC

> names and output it into a spreadsheet. Does anyone have any idea how this

> can be done?

 

Simply print out the list of computer names from the domain server.

 

 

 

--

 

Bruce Chambers

 

Help us help you:

http://www.catb.org/~esr/faqs/smart-questions.html

 

http://support.microsoft.com/default.aspx/kb/555375

 

They that can give up essential liberty to obtain a little temporary

safety deserve neither liberty nor safety. ~Benjamin Franklin

 

Many people would rather die than think; in fact, most do. ~Bertrand Russell

 

The philosopher has never killed any priests, whereas the priest has

killed a great many philosophers.

~ Denis Diderot

Guest Bruce Chambers
Posted

Re: Script to retrieve PC's serial numbers and names

 

Donny wrote:

> The serial number from the BIOS. I need to read from a list of computer names

> on the network and then retrieve the S/N's from them

>

 

Many makes and models won't have the serial number in the BIOS.

 

--

 

Bruce Chambers

 

Help us help you:

http://www.catb.org/~esr/faqs/smart-questions.html

 

http://support.microsoft.com/default.aspx/kb/555375

 

They that can give up essential liberty to obtain a little temporary

safety deserve neither liberty nor safety. ~Benjamin Franklin

 

Many people would rather die than think; in fact, most do. ~Bertrand Russell

 

The philosopher has never killed any priests, whereas the priest has

killed a great many philosophers.

~ Denis Diderot


×
×
  • Create New...