Page 1 of 2 12>
Topic Options
#28079 - 2002-08-29 10:52 AM Software inventory
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
No! Not another software inventory question!!!!

Actually I'm looking for what to do after you get all of this information. The script to collect the information is not the issue here. Once you collect the information from lets say 700 computers within a domain, what do you do with it? I'm not going to go through 700 files looking for information. Do you create a database by parsing all of these files and then run queries on the database? This seems like the best solution to me, but how do I do it? COM scripting? Can this be done with MS Access? Or is there a better way of doing this?

Since it's been about two years since I worked with Access and I remember very little of it I'm considering creating a generic database and creating kixforms to do the queries.

Is there a better and easier way of doing this?

Top
#28080 - 2002-08-29 10:57 AM Re: Software inventory
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
easier would be to do nothing with it [Big Grin]

what you want to do with it?

you can use normal text-files, databases, html...

it's just about what you want and need.
_________________________
!

download KiXnet

Top
#28081 - 2002-08-29 11:25 AM Re: Software inventory
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Well, the main thing I want to be able to do is have a list (ListBox) of software installed on a domain. Then when I select a particular piece of software from the list it would return a list of what computers that software is installed on. If you've ever used Ezaudit you would know what I was talking about.

Your right though, the easiest way would be to do nothing. The second easiest way would be to do it the way I already know. And the hardest would be doing it a way I don't know.

I'll probably opt for the second hardest.

Top
#28082 - 2002-08-29 11:40 AM Re: Software inventory
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
for fastest access, the correct way could be textfile.
then with array's you can group them...

In my invecha, i used html file which then was groupable with some dynamic changing of the file...
_________________________
!

download KiXnet

Top
#28083 - 2002-08-29 03:20 PM Re: Software inventory
Anonymous
Unregistered


Vig
What we do is this -

Mash all of the data into one comma delimited file, the first record containin column headings.

This obviously means you are denormalising your data.

We use this big CSV file as our mast file of Inventory, updating it daily, comparing yesterdays file against todays to track line by line changes (we just use LC and pip the output to a daily delta file).

The big CSV file can then be processed by command line stuff - like a FINDSTR to get a list of all sw on a given workstation name or a piece of software.

Or we can just load the file into Excel (calling it .CSV and having commas in it lets Excel pull the file in without any manual parsing dialogs) then we can use autofilters to do excatly what you are suggesting - each column heading becomes a pull down list, you can click on SW and get a list of all software products in the file, select one of them and filter the list by this product, likewise workstation name, likewise OS, memory size etc.

You can write your own filters to get memory less than 64 Mb etc.

The masterfile can become very large though (number of workstationsXaverage number of software products installed) so we often use the command line utils to filter the list down before we eyeball it, often we would use a small batch file to search a file for whatever, pipe the output into a another extract file, and then open it in excel.

The delta by day report is simple to produce and very useful - we only keep the latest days master report, and then a small delta file for each execution of the inventory. At one time we were processing the delta file and emailing some extracted information using blat.

Anyhow - not so elegant but it works fine, Hope that helps

Mark

Top
#28084 - 2002-08-29 03:24 PM Re: Software inventory
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I would go with a database approach, either e.g. a Microsoft Access Database file, or something more heavy like the free MSDE or it's big brother SQL Server.

You can then use SQL queries which can analyze your dataset in a lot of different ways, like which machines do have App1 installed or which ones don't.
_________________________
There are two types of vessels, submarines and targets.

Top
#28085 - 2002-08-29 03:35 PM Re: Software inventory
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Thanks for the info Mark. I'm really trying to automate this as much as possible since I probably won't be the one using it (I'm management... sorta).

sealeopard,
I still likle the idea of using an access database and have been scouring the boards looking gor examples. I did manage to find what looks like a great script to learn from but I can't get the darn thing to work.

Create/Read/Update MS Access Database

I've been messing around with it for a an hour but the most I can get it to do is make my floppy drive squak. Apparently I'm doing something wrong.

Top
#28086 - 2002-08-29 05:16 PM Re: Software inventory
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
vig, what about:
SortArray() - sorts multidimensional arrays

as, there is one mechanism, check it out.
_________________________
!

download KiXnet

Top
#28087 - 2002-08-29 05:55 PM Re: Software inventory
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Hmm interesting, I had heard of multi dimension arrays but didn't understand them till now. This has alot of potential. Thanks for the tip.
Top
#28088 - 2002-08-30 11:50 AM Re: Software inventory
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Well, I've figured out how to add the information to an Access database, but what would the best format for the database be?

At first I was thinking of having two tables. One computer table would have a field (column) for each computer and the records (rows) below would contain a program name entry. Another table for programs would have a field for each program and the records below would contain computer names. I was going to do it like this, but I can't find how to add fields (colomns) in ADO. If I can't add filelds I can't add more programs to the programs table and I can't add computers to the computer table. I would rather have created the DB this way since it would be much easier to do queries (at least as far as I can tell).

What I have ended up doing is creating one table with two fields, computer and program. If a computer has 10 programs installed then there will be 10 entries of the computer name in the computer field and one instance of the program in the adjoining program field. For my meager access skills this poses a problem. First, if I create a list box of the computers how will I edit out the multiple entries for the computer name. Second, same as the first but programs. Is it possible to create a form in access to have a listbox containing one instance of each computer and have a corresponding listbox containing all programs assoicated with that computer? I could probably do this in kixforms but that would create a mess with having to query the DB or read the entire DB into an array or arrays. Damn, I thought the hard part was over once I got the info into the DB. Any ideas?

If anyone is interested I'll post my code for parsing the software inventory files and then adding the data to the DB.

[ 30. August 2002, 11:51: Message edited by: Vig ]

Top
#28089 - 2002-08-30 02:13 PM Re: Software inventory
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
quote:

If anyone is interested I'll post my code for parsing the software inventory files and then adding the data to the DB.

I'm interested!

Rocco
You can email it to me if you'd rather...
roccocapra@yahoo.com
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#28090 - 2002-08-30 03:06 PM Re: Software inventory
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Ok here it is.

Heres a short UDF I wrote for testing purposes. All it does is collects the install info from another machine and then places the file in a directory. Once I have this thing setup for a logon script I'll change a few parts of it. If you look in the output file you'll notice it's all one line. I did this to make the parsing script faster. Instead of doing multiple readlines, it will only do one then split the output into an array.

code:
Break on
Function Software(optional $Computer,optional $LogPath)
If $computer = "" $computer = @wksta EndIf
Dim $programs
Dim $Subkeys
$index = 0
While @error = 0
ReDim preserve $subkeys[Ubound($subkeys)+1]
$index = $index+1
$subkeys[Ubound($subkeys)] = EnumKey("\\$Computer\HKLM\SOFTWARE\
Microsoft\Windows\CurrentVersion\Uninstall",$index)
Loop
$nul = ReDirectOutput ("$logpath$computer.log",1)
For Each $key in $subkeys
$Displayname = ReadValue ("\\$Computer\HKLM\SOFTWARE\Microsoft\
Windows\CurrentVersion\Uninstall\$key","Displayname")
If $Displayname <> ""
ReDim preserve $programs[Ubound ($programs)+1]
$programs[Ubound($programs)] = $Displayname
EndIf
Next
join($programs,"~*~")
$nul = ReDirectOutput("")
EndFunction

Here is the actual script that I'll run locally. You'll need to change the $DATABASE and $loggpath variables to point to where ever you want. You'll also need to create an access database with one table called TBL_PROGRAM. In the table there should be two columns, first "Computer" second "Program". I adjusted the field size of "program" to 100 because I was getting errors with the default 50.

Props to Breaker since I only modified his script. Also, I haven't looked into it but this script won't work with 4.10, I'm using 4.02 to run it.
code:
$=SetOption("WrapAtEOL","On")
$DATABASE = "\\yourcomputer\loggs\inventory.mdb";"
$DSN="Driver={Microsoft Access Driver (*.mdb)}; DBQ=$DATABASE"
$Connection = CreateObject("ADODB.Connection")
$Command = CreateObject("ADODB.Command")
$Recordset = CreateObject("ADODB.Recordset")
If $Connection
? "Connected"
$Connection.ConnectionString = $DSN
$Connection.Open()
$Command.ActiveConnection = $Connection
$Recordset.CursorType = 3
$Recordset.LockType = 3
$Recordset.ActiveCommand = $Command

$loggpath = "\\yourcomputer\loggs"
$file = Dir("$loggPath\*.log")
While $file <> "" AND @error = 0
$computer = SubStr($file,1,InStr($file,".log")-1)
$nul = Open(1,"$loggpath\$file") If @error <> 0 ?@serror Exit EndIf
$ProgArray = ReadLine(1) If @error <> 0 ?@serror Gosub End EndIf
$ProgArray = Split($ProgArray,"~*~")
For Each $program in $ProgArray
$CHECK_ENTRY_PROGRAM = "SELECT * FROM TBL_PROGRAM WHERE COMPUTER=
'$computer' AND PROGRAM='$program';"
$Command.CommandText = $CHECK_ENTRY_PROGRAM
$Recordset.Open($Command)
If $Recordset.RecordCount < 1
? "adding new entry record $program"
$Recordset.AddNew ?@SERROR
$Recordset.Fields("Computer").Value = "$computer" ?@SERROR
$Recordset.Fields("Program").Value = "$program" ?@SERROR
EndIf
$Recordset.Update
$Recordset.Close()
Next
?"$computer Completed Sucussfully"
:End
$nul=Close(1)
$file = Dir()
Loop
$Connection.Close()
$Connection = 0
$Recordset = 0
$Command = 0
Else
Goto error
EndIf
:end
Exit 321
:error
Exit

I think I may just create a gui using kixform to do queries instead of using an access form.

Hope you find some use for this.

Edited code to keep it from extending the width.

[ 30. August 2002, 15:12: Message edited by: Vig ]

Top
#28091 - 2002-08-30 04:37 PM Re: Software inventory
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Vig:

There are a couple of database UDFs in the UDF section:
DBConnOpen() @ http://81.17.37.55/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000194
DBConnclose() @ http://81.17.37.55/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000195
DBExecuteSQL() @ http://81.17.37.55/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000196
DBGetRecordset() @ http://81.17.37.55/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000197
DBRecordsetOpen() @ http://81.17.37.55/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000198
DBRecordsetClose() @ http://81.17.37.55/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000199

Currently, they are working only under KiXtart 4.02 but i'll rewrite them for KiXtart 4.11
_________________________
There are two types of vessels, submarines and targets.

Top
#28092 - 2002-08-30 05:36 PM Re: Software inventory
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Bring that on.. My access inventory is hosed when we to upgrade to 4.11.

I have a copy of my access inventory DB on my website along with the code that I use to populate it, if anyone cares.
at www.wheelerfam.com/documents/inventory.mdb

[ 30. August 2002, 17:41: Message edited by: Radimus ]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#28093 - 2002-08-30 05:47 PM Re: Software inventory
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
You link don't work Radimus.
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#28094 - 2002-08-30 05:52 PM Re: Software inventory
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
Thanks sealeopard, I plan on using those in the future.

Radimus, thank you very much for posting that. I've been looking all over for examples of ADO.

Top
#28095 - 2002-08-30 06:52 PM Re: Software inventory
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Rocco the link for Radimus' script is:

http://www.wheelerfam.com/Documents/inventory.kix

Top
#28096 - 2002-08-30 10:03 PM Re: Software inventory
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I actually have the MDB there also, I just can't get the link to work...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#28097 - 2002-08-31 01:23 PM Re: Software inventory
Vig Offline
Starting to like KiXtart

Registered: 2001-11-14
Posts: 166
Loc: Saudi Arabia
For what it's worth heres my (almost) final product for software inventory data.

 -
 -
 -
Hope the pics work.

Top
#28098 - 2002-09-03 05:31 PM Re: Software inventory
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Sorry, but the pictures do not work.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 834 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.073 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org