Hardware Inventory - Excel

Hello.
I am looking for a way to output a hardware report that is slightly different from the ones I see from within Comodo One or from the procedures that exist:

I need a list of ALL devices on the network, output to an Excel File that is sorted as follows:

At the top you have a row that shows all possible categories that are collected by One (DeviceName,Manufacturer, IP, Logged on User, Owner, Group, etc. etc.)
Below each of those a column with all the devices and their values.

Goal: I need to be able to sort the list by Device Name, by Mac-Adress, by Owner, by Manufacturer etc. etc. in order for the inventory list to be useful for us.

So in Excel when I click on a columns “header” and sort by it, I will get the list sorted by that criteria.
The more information is in there the better, if its possible to easily exclude information from the procedure (by deleting the non-relevant-parts for example) that would be fantastic, but I can do that in the Excel file by just deleting a column as well after running the procedure.

I would prefer to have that Excel file generated on a UNC Path in our network, timestamped so new versions dont just overwrite the older ones, but if that is too much work sending it via email is practicable as well for us.

Best wishes and thanks
Sébastien

Hi, @Taspharel

we will Analyze your script Request and will update you once its completed

Thank you

Hi @Taspharel ,

Your Request has completed. Please Refer the Below Script link:
https://scripts.comodo.com/frontend/web/topic/script-to-generate-hardware-inventory-details-of-selected-devices-as-one-report-and-sends-an-e-mail

Thank you

Hi, thanks.

I get the following error:

WindowsError: [Error 5] Access is denied: ‘C:\ProgramData\WInscp_folder’

I started the script as system user and as head computer I have my own hostname …

Same error here

we are reanalyzing the script procedure will reply with positive results as soon as possible

Hi @Taspharel @Marveltec

Good day to you

Taking your feedback on Script.

We analyzed the issue and found that.The script should run only once. Script takes at least 10 min to get the output,So wait until you get an email.

Conditions before running the script as follows:

  1. You need to select any device as head computer among group of devices that you are about to run a script
    Head_computer=r’DESKTOP-QM2LBEJ’

  2. Wait until your Head computer get Execution logs .

Thank you

Okay, I tried it just now using Googles smtp server and my private account there.

  1. I get the execution logs showing that the process was completed successfully (per device) and that the file was sent to the head computer (which should be the email, not the computer, right?).

But I never receive any email.

  1. One of the computers throws the error:

Type of ticket creator: PROCEDURE
Event Created at: Fri Dec 15 09:15:32 2017 GMT+0
Device Name: WSW10071
Logged on User: XXX (redacted)
Data: Traceback (most recent call last):
File “”, line 187, in
IndexError: list index out of range

  1. I cannot test because I dont receive the inventory via email, but judging from the Execution logs it seems to save one excel file per device, not an overview of all hardware in our domain collected in one file?

Hi @Taspharel

Now we have Updated the Script and please follow up all instructions which are in the description.

Please Refer the following link:
https://scripts.comodo.com/frontend/web/topic/script-to-generate-hardware-inventory-details-of-selected-devices-as-one-report-and-sends-an-e-mail

Thank you

Thanks for the update.
I followed the instructions on the wiki regarding gmail and startet the script with two machines (my head machine + another one). In the execution log I now get one result as being successful for the head computer, the other computer doesn’t show up.

No email is being sent - it has been 30 minutes since starting the script.

UPDATE: I deactivated 2 factor authentication and tried the steps from the wiki again. Now I get an email with an attached finalreport.xlsx (1KB) but it is corrupted.

Hi @Taspharel

Could you attach the finalreport.xlsx and which application you are using to open the report please mention it

Thanks

Attached - please unzip, it wouldnt let me just attach the xlsx file.

We are using Office 365 Pro Plus.

When I look at the file with Notepad++ there is content there, but Excel wont open it.

Finalreport.zip (1.66 KB)

Hi @Taspharel

Our python version doesn’t support xlsxwriter. so we have changed the format of the finalreport file to .csv. You can use any opensource office application to open the CSV file Eg.LibreOffice
Now we have Updated the script. let us know your feedback

please refer the following link:
https://scripts.comodo.com/frontend/web/topic/script-to-generate-hardware-inventory-details-of-selected-devices-as-one-report-and-sends-an-e-mail

Thanks, I’ll test it.
Another question, I got the message:

Type of ticket creator: PROCEDURE
Event Created at: Wed Dec 20 14:03:45 2017 GMT+0
Device Name: XXX(redacted)
Logged on User: N/A
Data: Traceback (most recent call last):
File “”, line 266, in
WindowsError: [Error 183] Cannot create a file when that file already exists: ‘C:\ProgramData\WInscp_folder’

…will this error appear for every computer that has already run the procedure once? Or is it a problem with a somehow uncomplete procedure?

Thanks!

Running the new procedure yields several errors:

Type of ticket creator: PROCEDURE
Event Created at: Wed Dec 20 16:15:10 2017 GMT+0
Device Name: xxx(redacted)
Logged on User: xxx(redacted)
Data: Traceback (most recent call last):
File “”, line 272, in
File “”, line 138, in download
IOError: [Errno 13] Permission denied: ‘C:\ProgramData\WInscp_folder\WinSCP_C1_SFTP.exe’

And:

Type of ticket creator: PROCEDURE
Event Created at: Wed Dec 20 16:15:05 2017 GMT+0
Device Name: xxx(redacted)
Logged on User: xxx(redacted)
Data: Traceback (most recent call last):
File “”, line 271, in
File “”, line 138, in download
IOError: [Errno 2] No such file or directory: ‘C:\ProgramData\WInscp_folder\WinSCP_C1_SFTP.exe’

And:

Type of ticket creator: PROCEDURE
Event Created at: Wed Dec 20 14:03:45 2017 GMT+0
Device Name: xxx(redacted)
Logged on User: N/A
Data: Traceback (most recent call last):
File “”, line 266, in
WindowsError: [Error 183] Cannot create a file when that file already exists: ‘C:\ProgramData\WInscp_folder’

And after 20 minutes so far no email with a csv file, but it may still come of course.

Also, something else I noticed: The CSV doesnt list the “owner” or the “group” fields, that would be very useful though for us … I guess this would require somehow linking up the information stored in the ITSM and the information from the computer itself?

Hi @Taspharel

Now we have improved our script as per your request

please refer the following link :
https://scripts.comodo.com/frontend/web/topic/script-to-generate-hardware-inventory-details-of-selected-devices-as-one-report-and-sends-an-e-mail

If you have any trouble in opening csv file then you can use any online csv file viewer
refer the link :
https://sheet.zoho.com/sheet/excelviewer

Thank you for your contribution with us

Thank you for your efforts.
Still no play though.

I defined the head computer (with the computer name of my admin-machine here, also tried with computername.domain.domain ), put in my email account and password, less secure apps is on as per instructions with the script.

The script starts seemingly fine and shows that it was executed in the log, but when looking at the details I get:

2018/01/19 02:19:22 PM Finished success Transfering File ............... Done File sent to Head Computer For your Information: Make Sure you Defined Head Computer
The file never appears on my computer or in my mailbox though.

I am also not clear on what the Folder Name will have influence? Will the event logs be saved there on the head computer under program data? If I read the script correctly thats where it should be saved … ?

Thanks for your ongoing work.

Sébastien

EDIT: Other procedures with the exact same email settings from my side work just fine.

Hi @Taspharel

Thanks for your valuable feedback

  1. Let me Explain the Script how it runs
    For Example :
    Device 1 – Let us Assume it could be the “Head Computer”
    The Output of Head Computer has follows

Transfering File … Done
File sent to Head Computer
Downloading File … Done
C:\ProgramData\kupido
The email report has been sent to XXXXXXXXXXX@gmail.com
For your Information:
Make Sure you Defined Head Computer

Remaining Devices which are not Head Computers
The Output of Remaining Devices has follows
For Example :

Transfering File … Done
File sent to Head Computer
For your Information:
Make Sure you Defined Head Computer

So here Head computer generates the report .

Regarding the Foldername

In order to avoid Naming Confusions while the script is running we included it and yes it saves in program data of the Head Computer .

Thank you

Hi. Thanks for the Explanation.

The Problem sadly remains:
When I run the procedure, it shows a success in the Execution Log but then nothing happens. No Report is sent.