Solved

Dell and HP Serial Number/Service Tag

Posted on 2014-10-17
16
1,086 Views
Last Modified: 2016-11-23
how do i command line into the boxes and retrieve hardware information and service tag number/serial number

i have access to the box just have many rather do them from my laptop
0
Comment
Question by:Jorge Ocampo
[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
  • 5
  • 5
  • 3
  • +2
16 Comments
 
LVL 9

Expert Comment

by:David Carr
ID: 40386788
Go to Start then Run and type cmd to start your command prompt.

type wmic csproduct get vendor,name,identifyingnumber


 and to save it in a text file add > c:\servicetag.txt to the end of the above line
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40386807
but that would have to be done on the actual server what about remote cmd?
0
 
LVL 1

Expert Comment

by:Gilbert Gonzalez
ID: 40386998
Jorge,

What David said should work even if you remote into each computer. Just remote into each one, run the CMD, and type the command that David specified (wmic csproduct get vendor,name,identifyingnumber). And as David specified if you want to create a text file so you don't have to copy the information from the CMD prompt, just do the following:

wmic csproduct get vendor,name,identifyingnumber > c:\hardwareinfo.txt

Where "c:\hardwareinfo.txt" can be any path you choose and any file name you would like to have. If they are all within the same network and you have a shared network drive you can specify that path instead so you can have them all in the same place. But remember to use the Fully Qualified name for the path (\\servername\sharename\filename.txt).

Hope this helps clarify further what David explained.

Any questions just let us know.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40387008
yes i got that part guys what i meant is how do i do a remote cmd not rdp into the machine
0
 
LVL 9

Expert Comment

by:David Carr
ID: 40387027
You can use wmic /user:youraccount /node:ip bios get serialnumber
   You will be prompted for the password for youraccount. Enter remote server's ip  after /node. If you use the remote server's hostname you have to use " around the name. e.g. wmic /user:youraccount /node:"server-name" bios get serialnumber
0
 
LVL 40

Expert Comment

by:footech
ID: 40387120
If you're interested in PowerShell, the equivalent of the wmic command is
Get-WmiObject Win32_ComputerSystemProduct | Select Vendor,Name,IdentifyingNumber

You can loop through a list of computers with
Get-Content computers.txt | ForEach { Get-WmiObject Win32_ComputerSystemProduct -ComputerName $_ } | Select Vendor,Name,IdentifyingNumber

Open in new window

where computers.txt contains a list of the computers you want to query (one name per line).
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40391973
Or you could get Vendor, Model Name, and Serial/Service Tag for every computer on your network or adjust Get-ADComputer to get what you want.

This will export to a CSV with the computer name as well
$computers = Get-ADComputer -Filter *
foreach ($computer in $computers) { 
Get-WmiObject Win32_ComputerSystemProduct -ComputerName $computer| Select @{Name="Computer Name";Expression={Get-ADComputer $computer | Select Name}},Vendor,Name,IdentifyingNumber | Export-CSV C:\ComputerInfo.csv -nti
}

Open in new window


This will use the list option
$computers = GC C:\computerlist.txt
foreach ($computer in $computers) { 
Get-WmiObject Win32_ComputerSystemProduct -ComputerName $computer| Select @{Name="Computer Name";Expression={Get-ADComputer $computer | Select Name}},Vendor,Name,IdentifyingNumber | Export-CSV C:\ComputerInfo.csv -nti
}

Open in new window

0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40392811
joshua where could i filter the OU that i want it to search through since i only care about servers
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40392828
You can just add searchbase
$results = @()
$computers = (Get-ADComputer -Filter * -SearchBase "OU=Servers,CN=Computers,DC=yourdomain,DC=com").name
foreach ($computer in $computers) { 
$results += Get-WmiObject Win32_ComputerSystemProduct -ComputerName $computer| Select @{Name="Computer Name";Expression={$computer}},Vendor,Name,IdentifyingNumber
}
$results | Export-CSV C:\ComputerInfo.csv -nti

Open in new window


or you can filter by operating system name (Enabled computers with server in OS name)

$results = @()
$computers = (Get-ADComputer -Filter {Enabled -eq $True -and OperatingSystem -like "*server*"}).name
foreach ($computer in $computers) { 
$results += Get-WmiObject Win32_ComputerSystemProduct -ComputerName $computer| Select @{Name="Computer Name";Expression={$computer}},Vendor,Name,IdentifyingNumber
}
$results | Export-CSV C:\ComputerInfo.csv -nti

Open in new window

0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40392852
can it be so it exports to cvs?
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40392858
I made a few corrections on my last post and it does export to CSV
0
 
LVL 40

Expert Comment

by:footech
ID: 40392863
@Joshua Grantom - Your examples include some unnecessary lookups and syntax/logic errors.
In the first one the simplest fix would be to modify line 1 to be
$computers = Get-ADComputer -Filter * | Select -expand Name
Then your WMI query will actually work.  Next when you're getting the computer name, there's no reason to do another query to AD, you already have the info (in $computer or could just use the PSComputerName property returned from the WMI query).  Lastly, since you're calling Export-CSV within a loop, you either need to have a unique filename for each loop, or use the -append parameter to avoid repeatedly overwriting the file (available with PS 3.0+).  You could avoid that with having Export-CSV outside a loop (for example by piping from the foreach-object cmdlet).
Get-Content computers.txt | ForEach { Get-WmiObject Win32_ComputerSystemProduct -ComputerName $_ } |
 Select PSComputerName,Vendor,Name,IdentifyingNumber | Export-CSV compinfo.csv -notype

Open in new window


EDIT:  I just saw that you've made some modifications which correct some of what I mentioned.
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40392872
Hey footech,

Thanks, my second posts made some changes, I realized that I was querying the same thing again as well as the export-csv not being outside the loop
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40392890
Joshua i see you are not filtering anymore is that right?
0
 
LVL 16

Accepted Solution

by:
Joshua Grantom earned 500 total points
ID: 40392905
I'm not sure what you are referring to Jorge?

To choose a specific OU this is what you would use
$results = @()
$computers = (Get-ADComputer -Filter * -SearchBase "OU=Servers,CN=Computers,DC=yourdomain,DC=com").name
foreach ($computer in $computers) { 
$results += Get-WmiObject Win32_ComputerSystemProduct -ComputerName $computer| Select @{Name="Computer Name";Expression={$computer}},Vendor,Name,IdentifyingNumber
}
$results | Export-CSV C:\ComputerInfo.csv -nti

Open in new window

0
 
LVL 40

Expert Comment

by:footech
ID: 40393421
It would have been appropriate to accept http:#a40387120 as an assist, as that was the first to give the main PowerShell code for retrieving the info from whatever remote servers you wish.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

738 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