fnh
New Member
Posts: 2
|
Post by fnh on May 23, 2022 19:22:03 GMT
Hi Everyone,
I have the following code set up in my UI++ XML:
<Action Type="TSVar" Name="OSDComputerName">"%department%"Left("%XHWAssetTag%",7)</Action>
Pretty simple code. It inserts the department variable from a user selection and then appends the serial number to the computer name in the MECM/SCCM task sequence.
I am running into an issue with imaging VM's (Vsphere specifically) because the serial includes whitespace between many of the characters. I had used the following code in powershell to resolve the problem in a previous task sequence:
$serial = $serial.Replace(' ', '')
$serial = $serial.Substring(7, 9)
But that is powershell and I'm not sure how to do this in the UI++ XML file. Any assistance or ideas on this would be greatly appreciated.
Thank you, Sterling
|
|
fnh
New Member
Posts: 2
|
Post by fnh on May 24, 2022 0:13:12 GMT
Nevermind on this, I got it. Thank you.
<Action Type="TSVar" Name="serial">Right(Replace("%XHWSerialNumber%", " " , ""), 7)</Action> <Action Type="TSVar" Variable="OSDComputerName">"%department%"+"%serial%"</Action>
|
|