I have previously published posts detailing how you can perform bulk updates to the database and how you can use the LTI wizard to prompt for information in ZTI deployments. Now I think it's about time I show you how to combine these two features and populate the database with the information gathered by the wizard.
This process can be very useful when you are trying to build a client that is not in the database. Generally the build process starts and a database lookup is performed to determine the settings, but there are no settings in the database so the build fails. This is not always the best situation and you may not want to manually update the database every time you need to build a computer.
So with this in mind I have created the solution detailed in the flowchart below:
The following steps detail how to implement this process.
First we must copy the following files to the deployment point. I have included a sample Custom_Wizard_Definition_ENU.xml file in the attached ZIP file.
Next we must update the deployment point bootstrap.ini file. I have included a sample bootstrap.ini and UserExit.vbs files in the attached zip file.
To update files on the deployment point, complete the following steps:
1. Add the CheckDatabase value to the properties line of the deployment point bootstrap.ini file:
2. Add the following lines to the [Default] section of the deployment point bootstrap.ini file:
3. If no user exit file currently exists, copy the userexit.vbs file to the ZTI folder.
4. Copy the CheckDB function from the userexit.vbs file provided to the current file.
5. Replace the <DB SERVER> value in the userexit.vbs file with the name of the server hosting the BDD 2007 database (for example, Data Source=MyDBServer).
The Custom_Wizard_Definition_ENU.xml contains the control information for the wizard. You must customize this file to meet your requirements. The sample file included in the attached file will only prompt for the computer name, but this can easily be updated to include other information such as roles or OU information.
So I hope this helps, it may not be used by everyone but there are certainly times when you will find this process invaluable.
For more detailed information about updating the database please refer to this post.
For more detailed information about using the LTI wizard with ZTI please refer to this post.
Note: These scripts are set up to use the MAC address as a unique key to store information in the database. You can easily update the scripts to use other values, such as a serial number or asset tag, if required.
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>
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!
I will be presenting a session at TechEd New Zealand on Monday covering Vista Deployment using BDD 2007. So if you happen to be attending make sure you come along, introduce yourself and ask lots of questions. I would like to put some faces to the names I regularly communicate with.
There will also be some fantastic giveaways during the session so it will be worth your while to attend!
In the past I have written a number of blogs about how you can use the LTI wizard to create a customized front end for your ZTI deployments. They detail both how to use the wizards to gather information, how to automatically enter this information into the database once you have gathered it and hint at how you could extend this functionality yourself without too much trouble.
So with that preface I must direct you all to Johan Arwidmark's site. Johan has created a pretty good ZTI front end in my opinion (as well as his own) using some of the techniques that I mentioned. He has taken it a lot further though and created a front end with a number of impressive features that is easy to understand and use. These features include:
However the feature that I am most impressed with is how it demonstrates the usefulness and simplicity and flexibility of the BDD LTI wizard. So if this front end doesn't provide all of the features you are looking you should be able to easily adjust it to meet your requirements.
So go and have a look at it yourselves I am sure you will mind it most useful!