Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using WMI to Set Asset Tag on HP's

Posted on 2011-02-21
4
Medium Priority
?
5,538 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 200 total points
ID: 34944994
0
 
LVL 7

Accepted Solution

by:
CSI-Windows earned 1800 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Simple Linear Regression
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

926 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