Solved

Using WMI to Set Asset Tag on HP's

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Part One of the two-part Q&A series with MalwareTech.
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

632 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