0

We have an API server which has details based on serial number of laptop/desktop.

Is there any way to check the details of the machine serial number and gather details from API server based on this machine while running the MDT and select the task sequence based on that automatically and install that specific task sequence?

Can anyone please suggest the possibilities and steps to acheive this.

@Elliot, I saw the link you shared, there the powershell task has options to create a ts variable.

powershell task in sccm

But, in mdt, there are limited options as you see.

powershell task in mdt

Sara June
  • 389
  • 4
  • 15
  • Yes, you can have PowerShell do the checks and set a TS variable by interfacing with the TS subsystem: https://docs.microsoft.com/en-us/mem/configmgr/osd/understand/using-task-sequence-variables#bkmk_run-ps. Even though it is for SCCM, it works in MDT too – Elliot Huffman Nov 03 '21 at 11:54
  • Can you check the details added above – Sara June Nov 05 '21 at 12:25
  • If you import the module for task sequences in powershell, you can create a new TS variable inside of powershell via code. You don't have to do it inside of them MDT itself because powershell interfaces with the task sequence subsystem – Elliot Huffman Nov 05 '21 at 16:05
  • Can you please share details about that – Sara June Nov 06 '21 at 06:52
  • It is in the first link I sent. You have to use the `TSEnvironment` object in PS during a running TS. That will allow you to interface directly into MDT from PS and manipulate execution, e.g. set a TS variable. – Elliot Huffman Nov 06 '21 at 11:42
  • I tried running a powershell script by keeping that in Deployment share\scripts folder and accessing that here but it is not executed. I just tested adding a firewall exception only for RDP but not working. Even I kept that as Operating System install, the "Configure1" in the above screen – Sara June Nov 06 '21 at 14:59
  • I don't understand what your issue is by the above text. Do you need help executing a PS script? Are you having issues accessing the `TSEnvironment` object? If you are having script execution issues, please open a new question. – Elliot Huffman Nov 07 '21 at 04:29
  • The options you provided may be working with sccm but they are not available with MDT. You can try in demo lab to confirm that – Sara June Nov 19 '21 at 19:44
  • They are available in MDT. I have done this before, see this tutorial for details: http://www.potentengineer.com/using-powershell-to-set-osd-task-sequence-variables/ – Elliot Huffman Nov 20 '21 at 03:10

0 Answers0