次の方法で共有


BDD 2007 - Tips and Tricks - Identifying hardware types

When using BDD to deploy and OS one of the first things it does is detect information about the hardware via WMI. As part of this detection process it determines the Chassis Type of the machine. By using this information we can configure the rules to perform different tasks based on the hardware type. For example we could base the computer name of the machine on the hardware type. So for example if the client type is a laptop then the computer could be the letter "L" followed by the computers serial number (also collected via WMI).

The chassis type is identified by the numeric value returned to BDD via a WMI query. These numbers are then matched to specific hardware types , these values and their corresponding hardware types are listed below:

Laptop: 8, 9, 10, 11, 12, 14, 18, 21

Desktop: 3, 4, 5, 6, 7, 15, 16

Server: 23

This information is returned in the form of a boolean value, so if the chassis type is a laptop then the %IsLaptop% variable will be true.

So with this in mind the following example shows how to name a machine based on the hardware type identified by BDD. I have also included an empty section that could be used if you machine was not a laptop ([Laptop-False]).

[Settings]

Priority= ByDesktopType, ByLaptopType,ByServerType, Default

[ByDesktopType]

Subsection=Desktop-%IsDesktop%

[ByLaptopType]

Subsection=Laptop-%IsLaptop%

[ByServerType]

Subsection=Server-%IsServer%

[Desktop-True]

ComputerName=D-%SerialNumber%

[Laptop-True]

ComputerName=L-%SerialNumber%

[Server-True]

ComputerName=S-%SerialNumber%

[Laptop-False]

[Default]

For further information on understanding rule processing please refer to this blog.

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 .

Comments

  • Anonymous
    January 01, 2003
    One of the things that I am often required to obtain for customers are certain WMI tags so that we can

  • Anonymous
    January 01, 2003
    Hi Tamas, Unfortunately you cannot have multiple subsections. This is the reason for the aproach I have taken. Thanks, Ben

  • Anonymous
    January 01, 2003
    Hi Ian, It is possible to have location based rules. There are lots of examples of this in the MDT documentation. This article shows you identify hardware types, so all you will need to do is reference the applications you want to use in the relevant section. Thanks, Ben

  • Anonymous
    January 01, 2003
    hi Ben Is it possible to utilise the rules to: 1: Create the deployment by gateway (ie location based rules for additional apps etc) 2: Also process whether the device is laptop or desktop as a further condition upon which further apps can be installed? Cheers Ian

  • Anonymous
    February 07, 2008
    How about doing it this way? [Settings] Priority= ByType, Default [ByType] Subsection=Desktop-%IsDesktop% Subsection=Laptop-%IsLaptop% Subsection=Server-%IsServer% [Desktop-True] ComputerName=D-%SerialNumber% [Laptop-True] ComputerName=L-%SerialNumber% [Server-True] ComputerName=S-%SerialNumber% [Default]