Set an Asset Tag number manually during SCCM TS, Lenovo ThinkPad’s

ZacAlam 1 Reputation point

Hi Folks,
I am trying to Set an Asset Tag number manually during SCCM TS for our Lenovo ThinkPad machines. Able to add a pane to MDT and ask for the Asset Tag and store it in a variable name 'TSAssetTag'. This portion works fine during OSD, I am not able to pass the value from the text field e.g. '1234' into the TS. I am not seeing the value from the text field anywhere in smsts.log. The end goal is to set the asset tag value and write to BIOS, I have a command line that I can run. I been looking online and closest articles I see is . We must use a manual entered value from the text field to write to the BIOS only, need to pass the variable that I get from the custom pane. The Code I am using in 2 steps of TS in PS is below. Not sure what i am doing wrong here? Any guidance here would be great, thanks!

  1. get Variable TSAssetTag
    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
    $tsenv.Value('TSAssetTag') = $TSAssetTag
    $LogPath = $tsenv.Value("_SMSTSLogPath")

2.\WinAIA64.exe -silent -set "USERASSETDATA.ASSET_NUMBER=$TSAssetTag"


Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
854 questions
Windows Autopilot
Windows Autopilot
A collection of Microsoft technologies used to set up and pre-configure new devices and to reset, repurpose, and recover devices.
441 questions
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
940 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Simon Ren-MSFT 32,066 Reputation points Microsoft Vendor


    Thanks for posting in Microsoft MECM Q&A forum.

    You can try to use ServiceUI to launch a batch file to set the asset tag like below.
    %ToolRoot%\ServiceUI.exe %windir%\system32\cmd.exe /c %SCRIPTROOT%\Lenovo_settag.bat

    For more detalied information, please refer to this similar thread: Interactive script in MDT

    Hope it helps. Thanks for your time.

    Best regards,

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. ZacAlam 1 Reputation point

    Thanks for your reply that did not work for me & errored out, The WINAIA64.exe Lenovo utility is in the Scripts directory of Deployment Share. I do not need to use ServiceUI as I have the custom pane for entering asset tag right and would prefer to leverage that instead. I need to pass the asset tag number when entered to the variable TSAssetTag. Then TSAssetTag to write to BIOS using .\WinAIA64.exe -silent -set "USERASSETDATA.ASSET_NUMBER=$TSAssetTag"
    Not sure what i am doing wrong still not getting the variable entered to set in asset tag....



  3. ZacAlam 1 Reputation point

    This is resolved.
    Net new machines created a MDT UDI Wizard TS as mentioned followed by Run Command Line .\WinAIA64.exe -silent -set "USERASSETDATA.ASSET_NUMBER=%TSAssetTag%" (looking at package during Run Command Line 'WinAIA64')
    Existing machines a bit more tricker , great help from , tweaked as below and added into a new TS.
    Run Command Line - ServiceUI.exe -process:TSProgressUI.exe %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File PROMPTFORASSETTAGv6.ps1

    PromptForAssetTag v6

    This script prompts for input during a task sequence, and sets the input as a TS variable.


    Close the TS UI temporarily

    $TSProgressUI = New-Object -COMObject Microsoft.SMS.TSProgressUI

    Prompt for input

    [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
    $TSAssetTag = [Microsoft.VisualBasic.Interaction]::InputBox("Enter Asset tag on the reverse of the machine", "AssetTag prompt", "eg 1234")

    Set the TS variable

    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
    $tsenv.Value("TSAssetTag") = $TSAssetTag

    New-Item -ItemType Directory -force -path c:\logs\AssetTag
    New-Item -ItemType Directory -force -path c:\Installers\AssetTag
    $date = (get-date)

    copy-item \***-sccm01\Sources\Applications\Lenovo\WinAIA64\WinAIA64.exe c:\Installers\AssetTag\WinAIA64.exe
    c:\Installers\AssetTag\WinAIA64.exe -silent -set "USERASSETDATA.ASSET_NUMBER=$TSAssetTag"
    write-output $date | out-file -encoding ascii -append -filepath 'c:\logs\AssetTag\assettag.txt'
    write-output 'assettag written to BIOS' | out-file -encoding ascii -append -filepath 'c:\logs\AssetTag\assettag.txt'

    0 comments No comments

  4. Mengda Huang 1 Reputation point

    Hi, Sir

    Thanks for your share.

    Could you share all of the task about how to get TSAssetTag from UDI which user insert? when i follow the step of your shared. i got the value of Lenovo BIOS Asset Tag was "%TSAssetTag%" not the really value which user insert from UDI windows.

    Thanks a lot.

    Best Regards,

    0 comments No comments