Script to retrieve PC's serial numbers and names

D

Donny

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?
 
P

Pegasus \(MVP\)

Donny said:
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?
 
P

Pegasus \(MVP\)

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.
 
B

Bruce Chambers

Donny said:
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://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
 
B

Bruce Chambers

Donny said:
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://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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top