Solved

Using WMI to Set Asset Tag on HP's

Posted on 2011-02-21
4
5,022 Views
Last Modified: 2012-05-11
Hello,
I have a WMI script which displays the asset tag for HP desktops/laptops/servers. "Asset Tag" is a configurable field in BIOS.

I dont know WMI / scripting too well, so my question is whether or not I can set or edit the asset tag using WMI? Anyone have a good idea on how I can attempt to do this?

Thanks!

WMI Script:
=========
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_SystemEnclosure")
For Each objItem in colItems
      Wscript.Echo "Asset Tag: " & objItem.SMBIOSAssetTag
NEXT
0
Comment
Question by:ottobock
  • 2
4 Comments
 
LVL 27

Assisted Solution

by:Lukasz Chmielewski
Lukasz Chmielewski earned 50 total points
ID: 34944994
0
 
LVL 7

Accepted Solution

by:
CSI-Windows earned 450 total points
ID: 34955515
If this can be done at all, it cannot be done with the standard Win32_SystemEnclosure class.  It would have to be a class object created by the hardware vendor as the details of how to write the asset tag would be different for every BIOS.

Also, if you have not previous set information Using WMI, you do not do it directly to a property (like setting a variable in VBScript) - instead you must call a method of the class to write data.

IF you have HP's management agents installed, then the HP_ComputerSystemChassis may have what you are looking for.

To find out if it does, download and install the WMI Administrative tools (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314).  Then use CIM Studio to open the "\root\hpq" namespace and search for HP_ComputerSystemChassis.  "UserTracking" is the asset tag.  Examine the "Methods" tab in CIM Studio to see if there is a method that will allow setting the Asset tag.  Clicking the specific method should show what parameters it takes and allow you to do a test run.

More information is here: http://bizsupport2.austin.hp.com/bc/docs/support/SupportManual/c02530446/c02530446.pdf and Here: http://www.docs.hp.com/en/diag/sfm/compsys_pds.pdf

0
 
LVL 7

Author Comment

by:ottobock
ID: 34972839
Big thanks for the great info! I'll be investigating this a bit further as time permits.  I felt it was not going to be a simple thing. (but I hoped) :-)
0
 
LVL 7

Expert Comment

by:CSI-Windows
ID: 34972885
Glad to help.  Could you take a moment to mark my information as the answer?
Thanks.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

773 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