How Can I Set The AssetTag in A Panasonic Toughbook or Toughpad’s BIOS using MDT 2013 or SCCM 2012?

By | November 22, 2014
Share

If you MUST input the ComputerName manually on a machine once, then store it in the BIOS, so the next time the unit is imaged, it can be pulled from the BIOS’s AssetTag value.

The first step to this setup is telling MDT2013 to attempt to use the AssetTag for the ComputerName value.  This is easily accomplished using the “%AssetTag%” variable as the OSDComputerName CustomSettings.ini rule.

[Default]
OSDComputerName=%AssetTag%

Next, we need to use the Panasonic’s AssetTag.exe utility to import the value into the BIOS.  This utility relies on the Panasonic Drivers being installed as well as the unit being booted into Windows.  So it is best handled in the State Restore phase, after the appropriate Panasonic One-Click Bundle is executed (https://panaconsulting.egnyte.com/fl/tdu1nkidMT).  Here is a the “application” source files, which I use to set the AssetTag value: OneDrive Link

The script uses the AssetTag.exe utility (Download Link).  This is included in the application source files.

UpdateAssetTagProperties

The script logs to the BDD.log as well as its own log file Z-AssetTag.log.

 

Here is the script source:

<job id="Z-SetAssetTag.wsf"> 
<script language="VBScript" src="..\..\Scripts\ZTIUtility.vbs"/> 
<script language="VBScript"> 
 
' //*************************************************************************** 
' // ***** Script Header *****
' // 
' // Solution: Solution Accelerator for Microsoft Deployment 
' // File: Z-SetAssetTag.wsf
' // 
' // Purpose: Sets AssetTag to the ComputerName for re-imaging purposes.
' // 
' // Usage: cscript Z-SetAssetTag.wsf [/debug:true] 
' // 
' // Panasonic Build Version: 1.0
' // Customer History: 
' // Mar 10, 2016 - First Build.
' // 
' // ***** End Header *****
' //*************************************************************************** 
 
'//---------------------------------------------------------------------------- 
'// 
'// Global constant and variable declarations 
'// 
'//---------------------------------------------------------------------------- 
'Option Explicit
Dim iRetVal 
'//---------------------------------------------------------------------------- 
'// End declarations 
'//---------------------------------------------------------------------------- 
 
'//---------------------------------------------------------------------------- 
'// Main routine 
'//---------------------------------------------------------------------------- 
'On Error Resume Next 
iRetVal = ZTIProcess 
ProcessResults iRetVal 
On Error Goto 0 
 
'//--------------------------------------------------------------------------- 
'// 
'// Function: ZTIProcess() 
'// 
'// Input: None 
'// 
'// Return: Success - 0 
'// Failure - non-zero 
'// 
'// Purpose: Perform main ZTI processing 
'// 
'//--------------------------------------------------------------------------- 
Function ZTIProcess() 
    iRetVal = Success 
    ZTIProcess = iRetval 

    '/ Create text file containing the ComputerName
    sCNameFilePath = oFileHandling.GetTempFileEx("txt")
    oLogging.CreateEntry "Z-SetAssetTag.wsf: Computername file set to """ & sCNameFilePath & """.", LogTypeInfo
    Set oCNameFile = oFSO.CreateTextFile(sCNameFilePath,True)
    oCNameFile.Write oNetwork.ComputerName
    oLogging.CreateEntry "Z-SetAssetTag.wsf: Wrote " & oNetwork.ComputerName & "to file.  Return: " & Err.number, LogTypeInfo
    oCNameFile.Close

	'// Execute the Assettag.exe with the new text file
	sAssetTagFilePath = oUtility.ScriptDir & "\assettag.exe"
	If NOT oFSO.FileExists(sAssetTagFilePath) then
		oLogging.CreateEntry "Z-SetAssetTag.wsf: " & sAssetTagFilePath & " was not found, unable to execute.", LogTypeError
		ZTIProcess = Failure
		Exit Function
	End if

	sCmd = sAssetTagFilePath & " /Y /F:" & sCNameFilePath
	oLogging.CreateEntry "Z-SetAssetTag.wsf: Running: " & sCmd, LogTypeInfo
	iRetVal = oUtility.RunWithHeartbeat(sCmd)
	
	If (iRetVal = 0) or (iRetVal = 3010) then
		ZTIProcess = Success 
	Else 
		ZTIProcess = Failure
	End If
	
	oLogging.CreateEntry "Z-SetAssetTag.wsf: Execute AssetTag.exe: Return code from command = " & iRetVal, LogTypeInfo
	oLogging.CreateEntry "Z-SetAssetTag.wsf: Execute AssetTag.exe: Complete", LogTypeInfo

End Function
</script> 
</job>

 

/BG

3 thoughts on “How Can I Set The AssetTag in A Panasonic Toughbook or Toughpad’s BIOS using MDT 2013 or SCCM 2012?

  1. Chris Markis

    I’m interested in saving information in the BIOS “ASSET Tag” field.
    Nowhere have I been successful in finding out the “max character length” of the tag.
    So please explain to me what the “max length of the ASSET Tag” field, is ??

    Also, We have MK3, MK4, MK5, MK6 Tough books, is there a separate asset tag utility for each, or can I use the same asset tag utility for all of them?

    Thank you in advance

    Reply
    1. Brian Gonzalez Post author

      Chris,

      I would suggest performing some testing to figure out the limitations using the AssetTag.exe GUI. Toss a huge string in there and see if it has built-in error checking for the string length. I also would try tossing in different special characters. From my experience, the latest AssetTag.exe is capable of writing the tag to all systems (backwards compatible). I do not work at Panasonic anymore though, so I can not help much more than this. Good luck my friend.

      /Brian

      Reply
  2. Chris Markis

    Respectfully, the above code is confusing.
    I’d really like a very simple 1 or 2 or 3 line Powershell script to set the asset tag on a Panasonic Tough Book.

    I found a webpage that says “you simply create a text file” and run ASSETTAG,exe /Y /F:.txt
    There is no information as to how many characters the asset tag holds (10, 36, 65, 80, ??), what characters are not allowed, nor any documentation, available. Not even error messages, when run.
    I have downloaded the Utilities from Panasonic, and found there are about 3 different versions. I have tried 2 with no results. It either provides a “Pop-up window” and asks for input, or using “/Y” you get no feedback.
    I continue to show “No Asset Tag” when I query the “SMBIOSassetTag”.

    I have had no problems setting up asset tags for DELL, and Surface Pro’s. Why is Panasonic so evasive?

    Reply

Leave a Reply

Your email address will not be published.

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.