MDT customsettings.ini userexit and multiple variables

Symbiot 21 Reputation points

Hi everyone,

I have userexit script that is querying a MySQL database:

Part of the file that is returned (writing from memory so it can contains typos but you can get idea) :
Do Until objRS.EOF
strReturn = strReturn & objRS.Fields("job_no") & _
objRS.Fields("table1") & ("|") & _
objRS.Fields("table2") & ("|") & _
objRS.Fields("table3") & ("|") & _
objRS.Fields("table4") & ("|") & _
objRS.Fields("table5") & ("|") & _
objRS.Fields("table6") & ("|") & _
objRS.Fields("table7") & ("|") & _
If strReturn = "" Then
WScript.Echo "nothing returned - check if record exists in database"
MySQL_JobQuery = strReturn
End If


I know MDT doesn't support MySQL but in our environment, we have 2x databases and I need to query both of them to pick the right image (SQL) based on details from MySQL before deployment even starts - and have to happen before any TS.

The query for MySQL works in windows PE and it returns a combined string as "table1|table2|table3.." etc and assigns it to
(customsettings.ini section)

My question is:
Is it possible to assign in userexit script more than one variables (not only MySqlQuery) used by MDT or do I have to write another script that split that string and then assign them like so


Maybe there's a better way of doing so.

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).
799 questions
0 comments No comments
{count} votes

Accepted answer
  1. AllenLiu-MSFT 38,406 Reputation points Microsoft Vendor

    Hi, @Symbiot
    Thank you for posting in Microsoft Q&A forum.
    A user exit script can contain one or more functions (not only MySQL_JobQuery), then you could get different VariableTable from different function.

    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 additional answers

Sort by: Most helpful