none
MDT 2012 - Logical operators in CS.ini

    Question

  • Guys,

    Is it possible to use logical operators in the CS.ini?  For example I want to specify if a computer has greater than 4.5GB RAM then go 64bit TS,  else go 32bit TS.  Possible to do just through the CS or require some sort of exit script? 

    Thanks!

    Monday, March 19, 2012 2:21 AM

Answers

  • Yepp, Nackers samples are very good... Here is also a simlar userexit script I put together for a customer a whil ago (the difference is I don't pass the Memory property to the script, I have the script calling it directly, but end result is the same). The customer wanted to select a ThinPC task sequence if memory was below 3 GB.

    ******** BEGIN scriptthatselectstasksequence.vbs *********

    Function UserExit(sType, sWhen, sDetail, bSkip)

                    UserExit = Success

    End Function

    Function GetTSID()

                    If oEnvironment.Item("Memory") > 3000 Then
                                    GetTSID = "W7-X64-001"
                    Else
                                    GetTSID = "TPC-X86-001"
                    End if

    End Function

    ******** END scriptthatselectstasksequence.vbs *********

    You call the script by configuring your cs.ini with the following:

    [Settings]
    Priority=Default
    [Default]
    OSInstall=Y
    Userexit=scriptthatselectstasksequence.vbs
    TaskSequenceID=#GetTSID()#

    / Johan

              

    Regards / Johan Arwidmark Twitter: @jarwidmark Blog: http://www.deploymentresearch.com FB: www.facebook.com/deploymentresearch

    • Marked as answer by mhouston100 Thursday, March 29, 2012 10:20 PM
    Tuesday, March 20, 2012 12:41 AM

All replies

  • You can use a userExit script as documented here:

    http://myitforum.com/cs2/blogs/cnackers/archive/2010/11/02/microsoft-deployment-toolkit-mdt-user-exit-scripts.aspx

    • Proposed as answer by JoeZeppy Monday, March 19, 2012 3:59 PM
    • Marked as answer by mhouston100 Thursday, March 29, 2012 10:19 PM
    • Unmarked as answer by mhouston100 Thursday, March 29, 2012 10:20 PM
    Monday, March 19, 2012 3:59 PM
  • Yepp, Nackers samples are very good... Here is also a simlar userexit script I put together for a customer a whil ago (the difference is I don't pass the Memory property to the script, I have the script calling it directly, but end result is the same). The customer wanted to select a ThinPC task sequence if memory was below 3 GB.

    ******** BEGIN scriptthatselectstasksequence.vbs *********

    Function UserExit(sType, sWhen, sDetail, bSkip)

                    UserExit = Success

    End Function

    Function GetTSID()

                    If oEnvironment.Item("Memory") > 3000 Then
                                    GetTSID = "W7-X64-001"
                    Else
                                    GetTSID = "TPC-X86-001"
                    End if

    End Function

    ******** END scriptthatselectstasksequence.vbs *********

    You call the script by configuring your cs.ini with the following:

    [Settings]
    Priority=Default
    [Default]
    OSInstall=Y
    Userexit=scriptthatselectstasksequence.vbs
    TaskSequenceID=#GetTSID()#

    / Johan

              

    Regards / Johan Arwidmark Twitter: @jarwidmark Blog: http://www.deploymentresearch.com FB: www.facebook.com/deploymentresearch

    • Marked as answer by mhouston100 Thursday, March 29, 2012 10:20 PM
    Tuesday, March 20, 2012 12:41 AM
  • Joe,  I had seen that script first before I posted here.  I had modified it but could not get it to run correctly no matter what I did.

    I'm a little confused as to the syntax for exit scripts (I've been off sick so haven't had a chance to look into it more yet), so the 'Userexit=x' needs to come before the function is called?  And is it also possible to put into a subsection?  If so does the  'Userexit=x' go in the same subsection?

    Basically we have two builds based on make, each with 32 and 64bit,  so I would like to put a different userexit script in each 'Make' section of the CS.ini to decide between the two architectures per build.

    Thanks for your help both of you,  I'll give it another shot today now that I'm back!

    • Edited by mhouston100 Tuesday, March 20, 2012 8:43 PM
    Tuesday, March 20, 2012 8:34 PM
  • Thanks Johan,  simple and effective,  worked like a charm.  Took a while for me to get back to it but implemented in less then two minutes.

    Thanks both of you for the help!

    Thursday, March 29, 2012 10:21 PM