Freigeben über


ConfigMgr 2012 Chassis Type Global Condition

What is a Global Condition?

"Global conditions in Microsoft System Center Configuration Manager 2012 are rules that represent business or technical conditions that can be used to specify how an application is provided and deployed to client devices. Global conditions can be created from the Global Conditions node of the Configuration Manager console or from within the Create Deployment Type Wizard. Global conditions are accessed and used from the Requirements page of the Create Deployment Type Wizard."

What is a Chassis and Chassis Type?

"The chassis is the physical container that houses the components of a computer. Chassis types include the tower configuration, desktop computer, notebook computer, and handheld computer."

What are the possible values for Chassis Type?

https://technet.microsoft.com/en-us/library/ee156537.aspx

What's the advantage of a Chassis Type Global Condition?

With the ability to target applications to Laptops, Desktops or Servers you can leverage the flexibility of Global Conditions within the new Application Model of System Center 2012 Configuration Manager. When leveraging requirements within the application model you can select the Global Condition for Chassis Type which will then be evaluated before the content is downloaded from the server and does not require a collection evaluation or refresh compared to setting these types of criteria on collection queries in result making the process more efficient then the process's we had in prior versions of Configuration Manager.

How to create the Chassis Type Global Condition:

1) Launch the Configuration Manager 2012 Console and expand Application Management > Global Conditions.

2) Right click the Global Conditions Node and select "Create Global Condition"

3) On the Create Global Condition Wizard fill out the Name, Description, Device Type, Condition Type, Setting Type and Data Type.

4) Next click Add Script and select VBScript

5) Either copy and paste the script code into the window or select browse to open an already created VBScript and select Ok.

6) Select Ok to save the Global Condition

7) You should now have a new Global Condition called Chassis Type

8) Now lets put it to use.  Open the Deployment Type for any application and go to the Requirements tab and select add.

9) On the Create Requirement's Wizard select Custom Category, Chassis Type for the Condition, Rule Type equals value, Operator = equals and Value = IsLaptop, IsDesktop or IsServer depending on your need and then select Ok.

10) On the Requirements tab select ok and save your application you are now ready to deploy with a custom global condition.

 

Script Code barrowed and lightly modified from ZTIUtility.vbs in the Microsoft Deployment Toolkit.

 Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
 Set objResults = objWMI.InstancesOf("Win32_SystemEnclosure")
 For each objInstance in objResults
 
 If objInstance.ChassisTypes(0) = 12 or objInstance.ChassisTypes(0) = 21 then
 ' Ignore docking stations
 Else
 
 Select Case objInstance.ChassisTypes(0)
 Case "8", "9", "10", "11", "12", "14", "18", "21"
 Wscript.echo "IsLaptop"
 Case "3", "4", "5", "6", "7", "15", "16"
 Wscript.echo "IsDesktop"
 Case "23"
 Wscript.echo "IsServer"
 Case Else
 ' Do nothing
 End Select
 
 End if
 Next

 Disclaimer: The information on this site is provided "AS IS" with no
warranties, confers no rights, and is not supported by the authors or Microsoft
Corporation. Use of included script samples are subject to the terms specified
in the
Terms of Use .

ChassisType.txt

Comments

  • Anonymous
    January 01, 2003
    @Zak no Global Conditions are not exposed in the Task Sequence so you have a few options if you are deploying applications in a TS you can leverage them on the App itself or you can integrate MDT into your TS and you can do the above IsLaptop=True as those variables will be present or you could just do a WMI Query as well and check for the existence of a battery which generally means its a laptop.

  • Anonymous
    February 19, 2013
    Perfect, thank you.

  • Anonymous
    April 12, 2013
    Thank you Just solved my Office deployment issue that I have been struggling with for 2 days.

  • Anonymous
    November 14, 2013
    This is great, but I'm a little confused: You want to ignore docking stations and via... If objInstance.ChassisTypes(0) = 12 or objInstance.ChassisTypes(0) = 21 then ' Ignore docking stations Else But in the else clause, you're still matching against 12 & 21... Else Select Case objInstance.ChassisTypes(0) Case "8", "9", "10", "11", "12", "14", "18", "21" Wscript.echo "IsLaptop" Can you clarify a bit on what's happening there?  (This a typo?)

  • Anonymous
    November 15, 2013
    @Julius It’s because docking stations return their own object instance – you didn’t see values 12 and 21 on the same object, you would get two objects.  So we loop through both of them, ignoring the docking station one and paying attention to the computer one.

  • Anonymous
    March 28, 2014
    Can I use this in OSD for say a group of steps? I only want to apply wireless setting if isLaptop = TRUE

  • Anonymous
    June 12, 2014
    "Script Code barrowed and lightly modified from ZTIUtility.vbs in the Microsoft Deployment Toolkit."

    Shouldn't that be "borrowed"?

    • Anonymous
      August 18, 2017
      We had to add "31" to laptops as some of our touch screen laptops especially the Yogas now use that.
  • Anonymous
    February 16, 2018
    The comment has been removed