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

ZacAlam 1 Reputation point
2022-05-03T23:05:23.607+00:00

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 https://social.technet.microsoft.com/Forums/en-US/b874abfd-3877-4348-8571-6679fc6ede61/using-mdt-custom-input-field-to-set-asset-tag?forum=mdt . 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"
198578-image.png

198500-image.png

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
    2022-05-04T03:08:10.71+00:00

    Hi,

    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,
    Simon


    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
    2022-05-04T09:32:10.197+00:00

    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....

    198640-image.png

    198784-image.png


  3. ZacAlam 1 Reputation point
    2022-05-23T16:32:11.68+00:00

    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 https://smsagent.blog/2014/01/30/prompting-for-input-during-a-task-sequence/ , 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
    $TSProgressUI.CloseProgressDialog()

    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
    2022-08-02T07:55:06.497+00:00

    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