Solved

Dell and HP Serial Number/Service Tag

Posted on 2014-10-17
16
1,168 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
Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

This article will help you understand what HashTables are and how to use them in PowerShell.
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

696 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