BDD2007 – Bulk database updates

I am often asked how I perform bulk updates to the BDD 2007 database. BDD 2.5 provided a tool to perform this task but BDD 2007 does not. To get around this issue I use a simple CSV import process.

Unlike the BDD 2.5 the BDD 2007 database is made up of multiple tables, so when adding computers to the database you must update all of the tables related to those computers.

For example when creating a new computer you must first create a record in the ComputerIdentity table. This will create an ID that links the computer to the MAC Address, UUID, Asset tag or Serial Number. Then you must create a record in the Settings table that links the ID created in the ComputerIdentity table with the settings that you want to apply to that computer. If you want to assign a role to the computer then you must create a record in the Setting_Roles table that associates the computer ID with the role.

Hopefully you are starting to see a pattern here...

This is not too hard to do but requires is is a little more planning when creating a script that will perform a bulk import of computers.

I have attached a sample script to this post that performs the following tasks:

     1. Reads the specified CSV file and extracts the following five properties:
           a. Computer Name
           b. MAC Address
           c. Machine Object OU
           d. OSD Install Package
           e. Computer Role (Single role only)

     2. Creates the computer object

     3. Assigns the correct OSDInstallPackage and MachineObjectOU to the computer

     4. Assigns a role to the computer

The script usage is as follows:

     cscript Computer-Import-CSV.vbs <Computers CSV file> <Database Server> <Database Name>

For example:  

     cscript Computer-Import-CSV.vbs "C:\computers.csv" DBSERVER BDDADMINDB

This script is just a simple example but hopefully it will get you started towards creating your own scripts to perform bulk imports to the BDD database. It should be fairly easy to update the script to import the settings you require. So go forth and create your own versions of this script and if you come up with any other cool idea's don't forget to tell me what you did:)

Note: I have attached a sample CSV file for your viewing pleasure!

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.

Ben Hunter - Bulk

Comments (3)

  1. Anonymous says:

    I have previously published posts detailing how you can perform bulk updates to the database and how

  2. Ben Hunter says:

    Hi Prudencio,

    This process is just a method to populate your database using a CSV. You will need to create the CSV yourself manually.

    If you have a look through my other blog posts you will see there is one that shows you how to update the database during image deployments.

    You can also update the database using the BDD interface.



  3. Prudencio Dimas says:

    New to BDD 2007 but was wondering how this .csv is created.  is possible to automate the population of these fields of the .csv

Skip to main content