Solved

Need help with modifying my PC Audit Report VB Script

Posted on 2006-10-25
6
419 Views
Last Modified: 2008-01-09
Hello experts,

I desperately need help with one of the scripts I use to report on recently built PCs...
The script uses WMI to interrogate the local PC and then outputs to an Excel spreadsheet.
This works OK only in the section relating to hard drive capacity etc it scans each disk for capacity, size etc etc.

The way it outputs to Excel is shown below:

HostName OS  SP Product ID Processor CPU Speed Socket Type Bus Speed MotherBoard Manufacture MB Product Device ID File System Disk Size Free Space Used Space Video Memory Physical Memory Virtual Memory
PC1 XP SP2 55274-640-1420133-23508 IntelP4 1794 Hz Microprocessor 133 Dell Latitude C640 C: NTFS 7.8Gb       0.7Gb 7.2Gb 32.0 Mb 511.4 Mb 1,756.4Mb
PC1 XP SP2 55274-640-1420133-23508 IntelP4 1794 Hz Microprocessor 133 Dell Latitude C640 D: NTFS 29.4Gb 7.0 Gb 22.4 Gb 32.0Mb 511.4Mb 1,756.4Mb
PC1 XP SP2 55274-640-1420133-23508 IntelP4 1794 Hz Microprocessor 133 Dell Latitude C640 E: NTFS 189.9Gb 38.8 Gb 151.1 Gb 32.0Mb 511.4Mb 1,756.4Mb

Some of the data (such as hostname, processor, cpu etc etc is replicated 3 times as there are 3 drives on the pc to be audited...

What would be great is if the main data (HostName OS  SP Product ID Processor CPU Speed Socket Type Bus Speed MotherBoard Manufacture MB Product / Video Memory Physical Memory Virtual Memory) was only output once and the drive data (Device ID File System Disk Size Free Space Used Space) for each drive output below the main data...

If anyone can help me with this problem I can send the whole script to you on request...

Many thanks

G.

0
Comment
Question by:thegordo
  • 3
  • 3
6 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17802301
You can upload files to this associated site:
www.ee-stuff.com
You use the same credentials as here.
You need to identify the question with the URL or ID.

Tell us back here if you do it. There is no automatic notification.
0
 
LVL 6

Author Comment

by:thegordo
ID: 17802861
I have now uploaded the file - please search for the question number 22036851 as a reference.

Many thanks for the prompt response...

G.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17810479
Strewth.
That's more of a project than a question. There are 162 variables declared outside procedures and possibly more local ones.
I think that it would be optimistic to say that there is at least a weeks' worth of work there. That's what I would charge for, anyway. It might actually be less if you do it yourself because a lot of the time would be spent just getting to understand the code and the objectives.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 6

Author Comment

by:thegordo
ID: 17810555
But the script does already work...

The only part which would need to be looked at is the part which outputs each partition or external hard drive data to a new line - rather than just outputting the hdd data it outputs the main system data which has already been output as well...

These are the lines in question surely...

Set DiskSet = oWMI.ExecQuery("select DeviceID, FileSystem, Size, FreeSpace " & "from Win32_LogicalDisk where DriveType = '3'")

ReDim strDisk(RowNum,4)
for Each Disk in DiskSet                                                   'Enable For audit of each PC's disks/partitions
      strDisk(RowNum,DEV_ID)= Disk.DeviceID
      strDisk(RowNum,FSYS)= Disk.FileSystem
      strDisk(RowNum,DSIZE)= FormatNumber(Disk.Size/2^30,1) & " Gb"
      strDisk(RowNum,FSPACE)= FormatNumber(Disk.FreeSpace/2^30,1) & " Gb"
      strDisk(RowNum,USPACE)= FormatNumber((Disk.Size-Disk.FreeSpace)/2^30,1) & " Gb"

Call AddLineToXLS(strHostName, strOS, strSP, strProdID, strProc, strSpeed, strSD, strFSB, strManufact, strMBProduct, strDisk(RowNum,DEV_ID), strDisk(RowNum,FSYS), strDisk(RowNum,DSIZE), strDisk(RowNum,FSPACE), strDisk(RowNum,USPACE), strVideo, strRAM, strVir, strPage, strUser, strNIC, strMask, strGate, strNameApp1, strNameApp2, strNameApp3, strNameApp4, strNameApp5)    
 
      Next                  'Enable For audit of each PC's disks/partitions
      

Thanks

G.
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 17811118
That is a bit clearer.
Is this what you mean? I can't test it (only one disc).

    ReDim strDisk(RowNum, 4)
    i = 0
    For Each Disk In DiskSet    'Enable For audit of each PC's disks/partitions
        i = i + 1
        strDisk(RowNum, DEV_ID) = Disk.DeviceID
        strDisk(RowNum, FSYS) = Disk.FileSystem
        strDisk(RowNum, DSIZE) = FormatNumber(Disk.Size / 2 ^ 30, 1) & " Gb"
        strDisk(RowNum, FSPACE) = FormatNumber(Disk.FreeSpace / 2 ^ 30, 1) & " Gb"
        strDisk(RowNum, USPACE) = FormatNumber((Disk.Size - Disk.FreeSpace) / 2 ^ 30, 1) & " Gb"
        If i = 1 Then
            Call AddLineToXLS(strHostName, strOS, strSP, strProdID, strProc, strSpeed, strSD, strFSB, strManufact, strMBProduct, strDisk(RowNum, DEV_ID), strDisk(RowNum, FSYS), strDisk(RowNum, DSIZE), strDisk(RowNum, FSPACE), strDisk(RowNum, USPACE), strVideo, strRAM, strVir, strPage, strUser, strNIC, strMask, strGate, strNameApp1, strNameApp2, strNameApp3, strNameApp4, strNameApp5)
        Else
            Call AddLineToXLS("", "", "", "", "", "", "", "", "", "", strDisk(RowNum, DEV_ID), strDisk(RowNum, FSYS), strDisk(RowNum, DSIZE), strDisk(RowNum, FSPACE), strDisk(RowNum, USPACE), "", "", "", "", "", "", "", "", "", "", "", "", "")
        End If
    Next                        'Enable For audit of each PC's disks/partitions
0
 
LVL 6

Author Comment

by:thegordo
ID: 17842364
That is brilliant! Many thanks!

G.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now