Solved

Need to get serial numbers from my Dell computers

Posted on 2006-06-21
6
1,083 Views
Last Modified: 2008-01-09
I have over 100 computers and I need to get their serial numbers.  These computers are Dell ones. How can I do this?

Thank you.

David
0
Comment
Question by:campomanes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:pml_siva
ID: 16957593
0
 
LVL 41

Accepted Solution

by:
graye earned 500 total points
ID: 16959427
pml_siva's suggestion is a good one... I'd also recommend that you use Windows Management Instrumentation (WMI) to obtain the serial number/service tag number.

Here is an example, to demonstrate the concepts.

using System;
using System.Management;
using System.Windows.Forms;

namespace WMISample
{
    public class MyWMIQuery
    {
        public static void Main()
        {
            try
            {
                ManagementObjectSearcher searcher =
                    new ManagementObjectSearcher("root\\CIMV2",
                    "SELECT * FROM Win32_ComputerSystemProduct");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    Console.WriteLine("-----------------------------------");
                    Console.WriteLine("Win32_ComputerSystemProduct instance");
                    Console.WriteLine("-----------------------------------");
                    Console.WriteLine("IdentifyingNumber: {0}", queryObj["IdentifyingNumber"]);
                    Console.WriteLine("UUID: {0}", queryObj["UUID"]);
                    Console.WriteLine("Vendor: {0}", queryObj["Vendor"]);
                    Console.WriteLine("Version: {0}", queryObj["Version"]);
                }
            }
            catch (ManagementException e)
            {
                MessageBox.Show("An error occurred while querying for WMI data: " + e.Message);
            }
        }
    }
}

If you're interested in looking at the source code to a complete solution, take a look at the SOSOS project's VB.Net source code at:  http://home.hot.rr.com/graye/Temp/SOSOSv3_Beta

It might a bit of overkill, (and it's in VB.Net) but feel free to plagerize any/all of the code.
0
 

Author Comment

by:campomanes
ID: 16965273
Hi,

I just ran the above code, but it gave me an error:  MessageBox. doesn't exist.

Any ideas.  

Thank you.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 41

Expert Comment

by:graye
ID: 16970507
The sample above is a for console application...

If you're interested in a complete solution, you might wanna take a look at the SOSOS project.  It's a free application for gathering ~200 pieces of information from computers on a LAN.  It can be run locally or it can be used the scan the network.  It's available as VB.Net source code.

Yeah, sure...it's probably overkill for what you're asking for, but on the other hand, once you get hooked on gathering information about your PCs, you might not be able to stop!

Here is an article from http://home.hot.rr.com/graye/Articles/SOSOS.htm
SOSOS version 3.0 Beta is now available at http://home.hot.rr.com/Temp/SOSOSv3_Beta
0
 

Author Comment

by:campomanes
ID: 16976625
Thank you so much.  Your code gets me serial number.

David
0
 
LVL 41

Expert Comment

by:graye
ID: 16979036
I botched the URL for the beta...

http://home.hot.rr.com/graye/Temp/SOSOSv3_Beta
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question