Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using WMI to Set Asset Tag on HP's

Posted on 2011-02-21
4
Medium Priority
?
5,447 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Simple Linear Regression

721 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