#28083 - 2002-08-29 03:20 PM
Re: Software inventory
|
Anonymous
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
|
|
|
|
#28085 - 2002-08-29 03:35 PM
Re: Software inventory
|
Vig
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
|
|
|
|
#28090 - 2002-08-30 03:06 PM
Re: Software inventory
|
Vig
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
KiX Master
   
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
|
|
Top
|
|
|
|
#28092 - 2002-08-30 05:36 PM
Re: Software inventory
|
Radimus
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 ]
|
Top
|
|
|
|
#28095 - 2002-08-30 06:52 PM
Re: Software inventory
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11625
Loc: CA
|
|
Top
|
|
|
|
#28096 - 2002-08-30 10:03 PM
Re: Software inventory
|
Radimus
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...
|
Top
|
|
|
|
#28097 - 2002-08-31 01:23 PM
Re: Software inventory
|
Vig
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 454 anonymous users online.
|
|
|