Important Notice: On February 29th, this community will be put into read-only mode. All existing posts will remain but customers will be unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Add Laptop / Desktop Condition To Deployments

It would be great if you could add a check in conditions for Laptops / Desktops.

 

Example: If its a laptop run if not don't.

0

Comments

10 comments
Date Votes
  • You could do this with an Inventory Collection, and then just deploy to the correct Collection.

    0
  • 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
  • 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
  • Interesting idea! Does the new ChassisType value need to be in inventory or does the condition run on the fly on the target?

     

    0
  • 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
  • Tested it on a target and I think it will work for what i'm doing.

     

    Thanks gents!

    0
  • 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
  • Sounds like something is preventing the registry change from staying. Maybe A/V? Or a GPO?

    0
  • 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
  • i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. Translate Good Evening to Russian

    -1

Please sign in to leave a comment.

Didn't find what you were looking for?

New post