none
Task that detects laptops and installs an application bundle RRS feed

  • Question

  • I have this task that attempts to detect laptops and install an application bundle, but it errors out.

    Its WMI query is 'select * from Win32_SystemEnclosure where ChassisTypes = "9"'.

    Friday, October 30, 2015 3:22 PM

All replies

  • Why not use the IsLaptop = TRUE MDT variable?

    The reason for the error is that the result of the query that you ran isn't a value, it's an array. You can't have a single value (9 in the example you use above) being compared to an array. Therefore use the IsLaptop variable which is generated by the MDT Gather action and uses the ChassisTypes value in WMI to calculate it.

    Friday, October 30, 2015 4:05 PM
  • I agree, it's easy to set stuff like that in customsettings

    Example:

    [Settings]
    Priority=Make, ByLaptopType, ByVMType, Default
    Properties=MakeAlias, ModelAlias, MyCustomProperty
    
    [Microsoft Corporation]
    TaskSequenceID=WIN10TAB_001
    Subsection=Microsoft-%Model%
    
    [Microsoft-Surface Pro 3]
    MandatoryApplications001={776aa2c2-6e24-43fc-b9b6-9f558992bfd9}
    
    [ByLaptopType]
    Subsection=Laptop-%IsLaptop%
    
    [Laptop-True]
    TaskSequenceID=WIN10OFF_001
    
    [ByVMType]
    Subsection=VM-%IsVM%
    
    [VM-True]
    BDEInstallSuppress=YES


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Friday, October 30, 2015 6:23 PM
  • I couldn't remember or find how to use the variable in a task. Could you remind me please?

    PS - I think I got it.

    adding task sequence variablecondition

    • Edited by KWFJ Monday, November 2, 2015 1:31 PM figured it out
    • Proposed as answer by Ty GlanderModerator Tuesday, November 3, 2015 7:05 PM
    Monday, November 2, 2015 1:20 PM
  • The example I gave is done in custom settings, what your example shows is you are setting the variable "IsLaptop" to equal "True" no matter what.

    If this post is helpful please vote it as Helpful or click Mark for answer.

    Monday, November 2, 2015 1:59 PM
  • Select the action that you want to have based on the IsLaptop condition

    Click the Options tab

    Add a condition for a TS variable and use the variable IsLaptop and the value of True.

    Note that you are not setting this value, it is set during the gather process, you are merely using the variable that has already been set as the deciding factor for whether to run that particular action.

    The screenshots you show above are correct.

    Monday, November 2, 2015 2:35 PM
  • Oops, yes I glanced at it too quickly and mistakenly thought of this:

    You are right Andrew. I should hold off on responding until after I have coffee and wake up.


    If this post is helpful please vote it as Helpful or click Mark for answer.


    • Edited by Dan_Vega Monday, November 2, 2015 2:42 PM caffeine deprived
    Monday, November 2, 2015 2:41 PM
  • Oops, yes I glanced at it too quickly and mistakenly thought of this:

    You are right Andrew. I should hold off on responding until after I have coffee and wake up.


    If this post is helpful please vote it as Helpful or click Mark for answer.


    A bowl of porridge and a nice mug of tea will set you straight ;)
    Tuesday, November 3, 2015 8:21 AM