Coding Thread, AutoIT and SQL help in Coding and Web Development; I'm working on a program to manually install software to machines via BITS and as part of it, I want ...
15th February 2011, 10:56 AM #1
AutoIT and SQL help
I'm working on a program to manually install software to machines via BITS and as part of it, I want the program to scan active dir for all computers (have done that bit) but then want it to put all those computer names into a SQL DB under a "machines" table.
Then, when you go to install a bit of software, it will update the DB to reflect what machine had what software installed.
The idea is that next time you run the program, if you were to try and install the software to the same pc it would see from the DB it's already done.
would anyone be able to help me work on this? basically it would be:
1) start program
2) program scans AD and puts all computer names it finds into temp array (done)
3) that list of machines is added to a SQL DB table
3a) if run a second time it will add new machines, delete ones not there anymore and leave the rest
4) you go to install (for eg) smartboard.msi it will add "Smartboard" to another table of the DB
5) a third table will tie the two results in. so it will show PC1 had smartboard installed
6) next time you run the software, you can click a button which shows what is installed where and it will read the third table and show accordingly
PC1 has Smartboard installed - installed on DD/MM/YY
nice and simple, see
IDG Tech News
15th February 2011, 11:09 AM #2
MSSQL/MySQL/SQLite? The best thing to do would be to look on the AutoIt forum for a UDF code module that interacts with your chosen database. I think AutoIt can interact with ODBC, but you'd need to ensure the workstation has the necessary ODBC driver installed for your database engine.
15th February 2011, 11:34 AM #3
i've had a look and there are MySQL/SQLite UDFs but not sure how maintained they are.
That part will be fairly easy, it's the actual coding of it and the logistics of it I'm trying to work out!
15th February 2011, 11:54 AM #4
It sounds like you need two programs - one to maintain the list of AD machines in the DB, and the other to install software and update the DB accordingly.
Try and flowchart how you want it to work (your list above is a good start!), and then work out what functions you'll need to code up to produce that one bit of functionality.
One way to get a fresh list of machines from AD into the DB, is to just empty the machines table each time. This saves a lot of checking for consistency and is one less area of complexity you have to worry about. As long as you use machine names as keys when referencing software installs, it should be fine.
15th February 2011, 04:07 PM #5
right so for refreshing lists it could just be a case of
- get list
- if table exists drop table
- import list to table (repeat on every run)
i know how i want it to work, but the problem is putting it into words on here to describe to others. the closest i can explain would be similar to how the RM console software overview works. it will show a list of software, list of machines and say whats installed where. but not in a grid view and not having to constantly update
15th February 2011, 09:19 PM #6
Don't use computer names, it breaks if you: a) Zap from AD then rebuild/reimage a computer with the same name, b) Rename a computer. I would use computer SIDs instead and (ephemerally) translate those to names whenever I needed to display them.
By bodminman in forum How do you do....it?
Last Post: 24th January 2011, 03:55 PM
By RabbieBurns in forum Scripts
Last Post: 16th June 2008, 04:47 PM
By K.C.Leblanc in forum Scripts
Last Post: 28th November 2007, 04:27 PM
By randle in forum Windows
Last Post: 11th July 2007, 10:26 AM
Last Post: 3rd July 2007, 02:29 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)