I think the best way is to create an ASSET_TAG server property, and then set that using an NSH script that uses the BLCLI to set the value of ASSET_TAG. I believe you can get the asset tag in the WMI. Look at the below code which creates a temp VBScript that queries the WMI for a property (I got this from an old client of mine):
echo "Found C:
tmp - ok"
tmp not found - creating..."
echo "objname = WScript.Arguments(0)\nprop = WScript.Arguments(1)\nset wmi = GetObject(\"winmgmts:\")\nset objectlist = wmi.ExecQuery(\"SELECT \" & prop & \" FROM \" & objname)\nfor each obj in objectlist\n WScript.Echo(obj.Properties_(prop))\nnext\n" > tmp.vbs
nexec $SERVER cscript //NoLogo tmp.vbs "$WMI_OBJECT" "$WMI_PROPERTY" | while read VALUE
VALUE=`echo $VALUE | tr -d '[:cntrl:]'`
SERVER_KEY=`blcli Server getServerDBKeyByName $SERVER`
echo "Setting $BL_PROPERTY of $SERVER to $VALUE."
blcli Server setPropertyValue $SERVER_KEY $BL_PROPERTY $VALUE
All you need to do is figure out where in the WMI the asset tag is located and pass it into the above script.
This worked great on most servers, Thanks!
I do have one scenario that I was wondering if you had any ideas on. I have a growing number of virtual machines in the datacenter and the serial number comes up as "VMware-50 0e d7 03 a0 fa 16 d7-fe d5 da 6b 2d 4e c7 46", whic fails to load in to OM with the following error.
I'm assuming it's because there are spaces in the $VALUE. Is there a way to allow this value to pass?
Nevermind, it seems it was a s simple as putting the $VALUE on the blcli line in quotes.