Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Friday, September 18, 2009

Automate Equipment Inventory to Database

It's been a while since I have posted to this blog. Mostly it has been because we had some major staff movements that have taken some time to work through to the point where making some space to write here is now somewhat realistic!

I want to share an improvement to a script I blogged in Feb 2007 which was about using a Windows Powershell script to query the WMI Win32_Product so as to retrieve information about all the software on a computer.

The original script output to a HTML file and has served us well, but I have occasionally thought that it would be great to also be able to write some or all of the data to a MySQL database. Recently I played around with this idea and managed to achieve a reasonable result.

I decided to use the .NET assembly available for this purpose from the MySQL site. The reason I decided to use the .NET assembly was that although the assembly can be installed using the installer the reality for distribution purposes was the the installer in fact copies in and then registers a .DLL file which if you want, can just be directly copied onto the target systems. Providing you specify the exact location of this file in the Powershell script, the fact that it is not "registered" does not matter!

Setup

  1. As the script writes output to a MySQL server located on another machine. You can get the setup for the MySQL server from my personal website.
  2. You can get a copy of the GetInventory_DB.ps1 Powershell script and copy this script to the desired location on the machine(s) you wish to get inventory data from.
  3. Also you will need to either install the MySQL .NET connector or download it and just copy in the .NET assembly .DLL file called "MySql.Data.dll" to the desired location on the machine(s) you wish to get inventory data from.

Note: If you use different file locations for these files than what the script uses, you will need to edit the script accordingly. Also you will need to edit the location of the MySQL server...

We schedule the script to run from the AT command once a day on the local machines when the workstations are not in use. This means that the data is up to date with any changes made in the previous 24 hours. Intially we are accessing the MySQL database using an ODBC connector and a MS Access Database. I have since written a PHP script that interacts with the MySQL database. Rename the script "search.php" and edit it in the places commented so as to reflect your database, username and password and it should work! (This script was copied directly from my test server...).





Friday, May 11, 2007

Clicker Application

Clickers have been a part of the education/entertainment scene now for some years. They are simple remote personal response systems which are used in group situations to answer questions from a group leader. Using clickers with well designed questions encourages more effective, more efficient, and more engaging communication.

Yet clickers are another physical item for users to carry, they have a cost and if they are not available when needed their value diminishes. I developed this .net application to run in a "computer lab" environment as a replacement for a physical clicker. The advantage for the user is that they don't have to buy it and or remember to bring it to a session.

The clicker software consists of 2 applications. One runs on a "master" computer and the other runs on any clients that are attached to the same network. A third element is required for these two applications to interact and that is a MySQL database. The database is a simple two table database which stores the client responses to the questions. Once the users have responded, the "Master" application then retrieves the data from the database and displays it in a window which can be projected for all to see.

I have the Clicker working in 4 "lab" environments running on XP work stations. I have also tested the Clicker on an "upgraded" Vista operating system. All seems to work as expected! I will test it further on a "clean" installation and update this comment accordingly with the results.

Links:
  • Instructions for downloading and implementing the Clicker Application.
  •