Brandon Linton - System Center and OS Deployment Blog

The Do's, Don'ts and what did i do's of System Center and OS Deployment...

ConfigMgr 2012 Chassis Type Global Condition

ConfigMgr 2012 Chassis Type Global Condition

  • Comments 6
  • Likes

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?

http://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.

Attachment: ChassisType.txt
Comments
  • <p>Perfect, thank you.</p>

  • <p>Thank you</p> <p>Just solved my Office deployment issue that I have been struggling with for 2 days.</p>

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

  • <p>@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. &nbsp;So we loop through both of them, ignoring the docking station one and paying attention to the computer one.</p>

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

  • @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.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment