Solved

Using WMI to Set Asset Tag on HP's

Posted on 2011-02-21
4
4,903 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

Too many email signature changes to deal with?

Are you constantly being asked to update your organization's email signatures? Do they take up too much of your time? Wouldn't you love to be able to manage all signatures from one central location, easily design them and deploy them quickly to users. Well, you can!

Join & Write a Comment

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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). …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now