Add Laptop / Desktop Condition To Deployments

Comments

9 comments

  • Stephen Valdinger

    You could do this with an Inventory Collection, and then just deploy to the correct Collection.

    0
    Comment actions Permalink
  • Daniel Swinford

    Very true but in this case I'm building a package with a lot of nested packages for new PC builds and having that option would be nice

    0
    Comment actions Permalink
  • Colby Bouma

    You could build a step that saves the Chassis Type into the registry and read that value in the next step.

    $Chassis_Type_Number = (Get-WmiObject Win32_SystemEnclosure).ChassisTypes

    # Chassis Type values from https://technet.microsoft.com/en-us/library/ee156537.aspx
    if ( $Chassis_Type_Number -In 8,9,10,11,12,14 ) {

    $Chassis_Type = "Laptop"

    } else {

    $Chassis_Type = "Desktop"

    }

    New-ItemProperty -Path "HKLM:\HARDWARE\DESCRIPTION\System" -Name "ChassisType" -PropertyType "String" -Value $Chassis_Type -Force

     

    0
    Comment actions Permalink
  • Daniel Swinford

    Interesting idea! Does the new ChassisType value need to be in inventory or does the condition run on the fly on the target?

     

    0
    Comment actions Permalink
  • Stephen Valdinger

    His code will run on the fly on the target. The only issue will be that the registry is tainted with the key that gets created, but it is of little worry. Nothing about it is harmful to the system. And, once you have that set, you could do cool things with Registry scanners in Inventory to separate things out based on Chassis type. It's a very cool trick.

    0
    Comment actions Permalink
  • Daniel Swinford

    Tested it on a target and I think it will work for what i'm doing.

     

    Thanks gents!

    0
    Comment actions Permalink
  • Daniel Swinford

    I wanted to update you on something I've found. You can write that to the registry but it disappears after a reboot.

    Just an FYI

    0
    Comment actions Permalink
  • Stephen Valdinger

    Sounds like something is preventing the registry change from staying. Maybe A/V? Or a GPO?

    0
    Comment actions Permalink
  • Daniel Swinford

    I just tested it on a new Windows 10 build with no software and not joined to the domain and it disappears after boot.

    For what i'm doing that's fine. Again I just wanted to share how it is behaving.

    0
    Comment actions Permalink

Please sign in to leave a comment.