PCExporter - A Utility to Help Deployment Solution Migrations
PCExporter is a Visual Basic 6 application which allows you to export clients from Deployment Solution's eXpress database. The output is in the format recommended by Altiris for importing through the console.
Motivation
I recently had to migrate clients from a DS6.5 server to a DS6.8 Server. I tried the DSExp utility provided by Altiris but it gave the following headaches,
- In import mode it overwrites the security configuration
DSexp won't allow computers to be imported without the security. The problem is, our new DS is in a new domain, with different securities configured. Using DSExp resulted in admin access being lost for the console which we had to fix by restoring the eXpress DB from backup. - No granularity
A small point, but there is no granularity. It can only export all computers. This means deleting computers you don't want manually from the new server's console after import.
There is scant documentation out there for DSExp, so I had no idea whether I could bend it to my needs. Time was pressing, so I wrote PCExporter. You can think of it as DSExp-Lite.
How it Works
PCExporter functions by asking you to provide the following details,
- Your Deployment Solution NetBios Name
- Credentials with suitable access rights
- A Computer Group to export
After entering all these details, clicking the Export button on the form sends the application away to the following checks,
- General form sanity check
Have the boxes been filled out ;-) - Database connectivity Test
Using the ADO connection object, I attempt to connect the eXpress database,db.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=" & user & ";password=" & Password & ";Initial Catalog=express;Data Source=" & server db.Open
- Group existance test
I wanted to query the database and build a tree-view of the groups which you could navigate through to select your target group. What I have though is a textbox, so I have to go a sanity check that the group entered exists. If nothing is entered in the group box, the "New Computers" group is assumed. I'm not entirely happy with this, so maybe i'll make this better if I have time later.The group sanity check is done by the following code,
Set rs = New ADODB.Recordset SQl = "select name,group_id from computer_group where name like Group_Str" rs.Open SQl, db
Once the sanity checks have been done (check the log window for the results) the application starts the real work,
- A 'directory walk' of the groups table computer_group in the eXpress database is performed. This allows a list of all the groups under the parent you've selected to be logged.
- Each group logged above is then scanned for computers. All computers found are outputted to the output window. (Note: Computers will appear multiple times in the queries if they have multiple NICs. These duplicates are gathered into single entries in the output window, with the multiple NICs declared.)
The Output Format
The output format only includes console name, computer name and MAC addresses. This might seem a massive oversite at first but there is a reason for this. The first version I wrote outputted nearly everything. This looked great, and was very satisfying. The problem was however, that many machines had Asset numbers of "Asset No. not found" and Serial numbers of "NONE". On import, these were seen as duplicates, and conflicted.
So, the format of each entry is along the lines of,
OUCS-ICT-TOSH,000E7B24719H,,,OUCS-ICT-TOSH,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\Staff\ICTST,,,0018CEC6E6H6,,,,,,,,
This lack of information isn't a terrible loss though -when you re-point your clients to the new Deployment Server all the rest of their details get filled in.
UUID Gotcha
I got caught out with this, so I'd better mention it. As the Computer UUID is not an importable parameter for computer imports, you are implicitly assuming that the lookup is on NIC MAC address or name. Ensure the server you are importing to has the primary lookup key set accordingly, or your migrated machines will appear in the console root.
Example Usage
Lets now take a look at how to use this little app. When you double-click on PCExport.exe you should be presented with the popup as shown in the graphic. There are 4 sections to the form; a credentials area, the group area with export button, the output window and a log window.
The credentials area is pretty self explanatory -put in your DS Server name here with a credential you've granted access. I like to keep a SQL user tucked away in my SQL Server with the public access to the eXpress. This is a bare minimum access right, which guarantees any application using it can't do anything but read the data. You could use the sa account if you wished.
The group textbox allows you to specify the group you wish to export, and the Export button is the action button. Press this, and your form data will be punched into the SQL code, and off the application will trot.
The output window is where you'll find export text for the PC found in the group specified, and the log window is informational. Any errors and informational messages are posted here.
Opposite is an example of the app being used. As you can see, I've entered in a credential expressuser to connect to the express database with. This is my limited SQL user -it only has public rights on the express database. I've entered a folder called "Bridget" and its searched through and found 9 machines. The output window is populated with the text, ready for your own version of the ImportComuter55.txt file.
Caveats
Usual caveats apply. Should your server room go up in smoke you can't sue me. But, if it really does, can you please send pictures - you just can't buy publicity like that...
And don't even ask for the source unless you've given me some Juice points... ;-)
Kind Regards,
Ian./
| Attachment | Size |
|---|---|
| PCExport.zip | 32.96 KB |
- Login or register to post comments
- 1526 reads
- Printer-friendly version

















Compatibility DS 6.1
Interesting tool, do you think it can be used also to migrate from DS 6.1 server ?
Thanks
Paolo
Don't see why not
The tables queried in this tool to create the import file are nothing special. I don't see any reason why you couldn't use this tool to export from any version of DS.
Kind Regards,
Ian./
Nice tool! But missing some things...
Hi!
I really miss the following options;
* Windows Authentication for DB
* Option to enter database name (not eXpress)
Something you can fix? :)
Robert Lundsten
Asterio AB - System Management Solutions
http://www.asterio.se
I'll take a look
Windows Auth i'm not sure about -will have to take a look. Changing the DB is simple though.
I'll see what I can do, but it may take a while as i'm a bit busy just now.
Kind Regards,
Ian./
Thanks!
Robert Lundsten
Asterio AB - System Management Solutions
http://www.asterio.se