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 .