WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

WMI
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Asset Tag From Computers

 Keywords: Get Asset Tag Dell Win32_ComputerSystemProduct IdentifyingNumber AssetTag WMI WbemScripting.SWbemLocator Serial Number SerialNumber

Question:

How can I get assettag from dell computers?

Answer:

It looks like the IdentifyingNumber property of the Win32_ComputerSystemProduct class seems to do the job. has been tested getting the asset tag from Dell, HP, IBM, and Panasonic computers:

objLocator = ObjectCreate("WbemScripting.SWbemLocator")
objService = objLocator.ConnectServer(".","root/cimv2","","")
objSecurity = objService.Security_
objSecurity.ImpersonationLevel = 3
class =  "Win32_ComputerSystemProduct"
; query instances
query = "SELECT * FROM ":Class
colInstances = objService.ExecQuery(query)

; loop once for each instance
ForEach objInstance in colInstances
  ;Check if Object is EMPTY
  type = ObjectTypeGet(objInstance)
  if type=="EMPTY" then break
   ; obtain properties
   Asset = StrTrim(objInstance.IdentifyingNumber)
   Model = StrTrim(objInstance.Name)
   Vendor = StrTrim(objInstance.Vendor)   
Next
Message(`Results`,StrCat(`Asset = `,Asset,@CRLF,`Model = `,Model,@CRLF,`Vendor = `,Vendor))

; close object handles
colInstances = 0
objSecurity = 0
objService = 0
objLocator = 0

Article ID:   W18471
Filename:   Get Asset Tag From Dell Computers .txt
File Created: 2013:07:25:08:39:08
Last Updated: 2013:07:25:08:39:08