none
About UserExit script RRS feed

  • Question

  • Hello,everyone

            My UserExit set as follows,but not working for me, anybody can help me ?

    [Settings]
    Priority=UE,TaskSequenceID, CSettings, CAdmins, CRoles,Default
    Properties=MyCustomProperty, ADGroup

    [UE]

    Userexit=MyCustomFunctions.vbs
    TaskSequenceID=#SetTaskSequence(vMemory)#

    [Default]
    OSInstall=YES

    ADGroup=LDAP://OU=ITOU,DC=mdt,DC=com
    ScanStateArgs=/v:5 /o /c
    LoadStateArgs=/v:5 /c /lac /lae

    SkipAppsOnUpgrade=YES
    _SMSTSOrgName=IT-Helpdesk
    SkipBDDWelcome=YES
    SkipCapture=YES
    DoCapture=NO

    …………

    [Win7_001]

    SkipDomainMembership=YES
    JoinWorkGroup=WorkGroup

    SkipApplications=YES
    Applications1={400fbc42-a1e7-4e7f-8242-026eb2f6daf6}
    Applications2={43b5ce64-98b2-46ec-a808-568f68e98f1d}

    [Win7_002]

    SkipDomainMembership=YES

    JoinDomain=mdt.com
    DomainAdmin=Administrator
    DomainAdminDomain=mdt
    DomainAdminPassword=Passw0rd!

    MachineObjectOU=OU=MachineOU,DC=mdt,DC=com

    SkipApplications=YES
    Applications1={35bb5806-3adf-4996-9ea4-fb45c2c15a27}
    Applications2={5a9887d3-4b18-4a73-8fa1-75ed13dd58f9}

    ****MyCustomFunctions.vbs ****
    Function UserExit(sType, sWhen, sDetail, bSkip)
      UserExit = Success
    End Function
    Function SetTaskSequence(vMemory)
    oLogging.CreateEntry "UserExit - Determining Task " & _
        "Sequence to run based on available RAM", LogTypeInfo
     
      If vMemory <= 2048 Then
        SetTaskSequence = "Win7_002"
        oLogging.CreateEntry "UserExit - Available RAM: " & _
          vMemory & ". Selecting Win7_002 TS.", LogTypeInfo
      Else
        SetTaskSequence = "Win7_001"
        oLogging.CreateEntry "UserExit - Available RAM: " & _
          vMemory & ". Selecting Win7_001 TS.", LogTypeInfo
    End If
    End Function

    Monday, August 19, 2013 8:52 AM

Answers

All replies

  • Change to:

    TaskSequenceID=#SetTaskSequence(%Memory%)#

    You don't define and set vMemory anywhere.

    ZTIGather can automatically expand out other variables like Memory before calling the vbscript.


    Keith Garner - keithga.wordpress.com

    Wednesday, September 4, 2013 6:42 AM
    Moderator
  • @Keith Garner Thank you very much! I change it to "TaskSequenceID=#SetTaskSequence(%Memory%)#" ,at the same time, i change the “vMemory” to "Memory", now,everything working fine.
    Wednesday, September 4, 2013 2:27 PM