Excel and HTML Asset Reports With Powershell

This set of powershell functions collates and generates reports upon system information it gathers. Information gathered includes hardware health, system information, networking information and much much more. Multiple types of html reports can be generated and all data can be exported directly to an excel workbook, saved as individual reports, and emailed.

The reports offer a high level of data customization and currently come with two example data sets. One for daily system reports which contains less overall information. And another, far more inclusive, system documentation report. The html output can be highly customized as well. Currently there is a dynamic grid html report based on responsive design templates as well as a less glitzy email capable html format. The report data can also be returned directly to an excel workbook where several sheets will automatically populate and be formatted for easier reading and further manipulating.

Features

Generate system asset reports in multiple formats including:

  • Report Containers/Types
    • Troubleshooting – A small subset of system information meant for daily reports
    • Documentation – A large amount of system information meant for environment analysis and documentation
  • HTML Templates
    • DynamicGrid – A heavily modified CSS layout
    • EmailFriendly – A basic layout
  • Saved Report Layout
    • Individual – Each asset saves as its own file
    • One big report – All assets are included in one big report
  • Saved Report File Format
    • HTML
    • PDF *New*
  • Email Reports (HTML only)

Report Data

Sections included in the system asset report include:

  • System Information
    • Summary
      • OS
      • CPUs
      • Memory Usage
      • Server Models
      • Virtualization detection
    • Extended Summary
      • NTP information
      • Product key
      • Registration Info
    • Dell Warranty Information
    • Disk Report
    • Environmental Variables *New*
    • Memory Banks
    • Top processes by memory utilization
    • Startup Commands *New*
    • Stopped services (which are set to start automatically)
    • Services starting with non-standard credentials
  • Event Log Information
    • Event Log Settings
    • Event log errors/warnings/security failures for past number of hours
  • Networking Information
    • Network Adapters
    • Local Hosts File Contents *New*
    • Local DNS Cache *New*
    • Route Table
  • Software Audit
    • Installed Hotfixes
    • Installed Applications
  • File/Print
    • Shares
    • Share session information
    • Printers
    • VSS Volume Usage *New*
    • VSS Writers *New*
    • WSUS settings
    • Installed printers
  • Local Security
    • Local Group Membership
    • Applied GPOs
  • HP hardware health
    • HP general hardware health
    • HP ethernet team health
    • HP ethernet health
    • HP fan health
    • HP HBA health
    • HP power supply health
    • HP temperature sensor readings

Version Info

1.1.0 – 09/22/2013

  • Added option to save results to PDF with the help of a nifty library from https://pdfgenerator.codeplex.com/
  • Added a few more resport sections for the system report:
    • Startup programs
    • Local host file entries
    • Cached DNS entries (and type)
    • Shadow volumes
    • VSS Writer status
  • Added the ability to add different section types, specifically section headers
  • Added ability to completely skip over previously mentioned section headers…
  • Added ability to add section comments which show up directly below the section table titles and just above the section table data
  • Added ability to save reports as PDF files
  • Modified grid html layout to be slightly more condensed.
  • Added ThrottleLimit and Timeout to main function (applied only to multi-runspace called functions)

Notes

I suppose I’ll upgrade this from beta status to non-beta, or whatever comes next. I’m mostly happy with the report layout and formatting for the DynamicGrid template. I’ve also breached new ground with a whole new set of data results for inclusion in the asset reports (with a recently released set of functions for returning the results of a remotely run command via alternate credentials). The EmailFriendly format still needs some attention but should serve its purpose.

While the reports are pretty, I think that the real value to professionals is in the excel export this script can automatically generate. You can determine a whole lot from the information this script gathers. You can quickly isolate nic cards in promiscuous mode, find servers using strange license keys, and more.

Screenshots

One of the excel sheets

The HP hardware health section of an html report:

A summary section of an html report:

A disk usage html report section:

Downloads

Download the script from the technet gallery (more frequently updated)

Comments (17)

  1. 9:29 AM, 08/20/2015Sojhu  / Reply

    Hi Zachary,

    I’m using Sean Duffy script successfully, and want to try your.

    I’m executing the script like this:

    $Servers = Get-Content C:\temp\list.txt
    c:\temp\New-AssetReport.ps1 -Computers $Servers -PromptForInput -Verbose

    but at the end no html reports are generated, nor email send.

    Do you have an idea of what I’m missing.

  2. 2:56 PM, 06/04/2014Cary  / Reply

    I am trying to run your report and want to save all of my servers to a single HTML file. I have tried the -OutputMethod ‘OneBigReport’ ` and it won’t do anything from there. Thanks for the help

    • 7:33 PM, 06/04/2014Zachary Loeber  / Reply

      Any output if you add the -verbose option?

      • 6:46 AM, 06/05/2014Cary  / Reply

        This is the command I’m running:
        .\AssetReport.ps1 -ADDialog -PromptForCredentials -Verbose -OutputMethod ‘OneBigReport’ `

        And get nothing. If I run the the following:
        .\AssetReport.ps1 -ADDialog -PromptForCredentials -Verbose

        I get each server in a separate HTML file.

        • 8:47 AM, 06/05/2014Zachary Loeber  / Reply

          Interesting, does it even give you the AD selection pop-up?

          • 9:39 AM, 06/05/2014Cary 

            No it doesn’t. I just sits there.
            PS C:\testing> .\AssetReport2.ps1 -ADDialog -PromptForCredentials -Verbose -OutputMethod ‘OneBigReport’ `
            >>

            That is what I get.

  3. 10:09 AM, 03/11/2014Will  / Reply

    Zachary you are awesome. Having the keys in the report would be a big help. Our primary concern is Microsoft, Adobe, AutoDesk products.

  4. 9:32 AM, 03/10/2014Will  / Reply

    I love your script. One question, is there a way to have it list product keys for installed software (Microsoft and Non-Microsoft.)

    This would help with auditing.

    Thanks

    • 4:25 PM, 03/10/2014Zachary Loeber  / Reply

      I can set it to gather information on anything which can be gathered from the registry or wmi. If there are other product keys you know can be gleaned in this manner send it along and I’ll do my best to get it added.

      Cheers,
      Zach

  5. 12:25 PM, 02/06/2014David O  / Reply

    Is it possible to run the script without having to prompt the credentials or use the credentials that opened the powershell window? I’m asking because I would like to set it up as a scheduled task on a server.

    • 12:44 PM, 02/06/2014Zachary Loeber  / Reply

      Sure, schedule the task to run as the account which has access to the servers you are running the report against. Let me know how it goes as I’ve not had to schedule this script to run in scheduled tasks up to this point.

      Thanks!
      Zach

      • 1:19 PM, 02/07/2014David O  / Reply

        Would I have to comment out the lines $Cred = Get-Credentials and -Credentials $cred ?

        • 2:59 PM, 02/07/2014Zachary Loeber  / Reply

          Yeah, if the account you run the script as already has admin rights to the remote systems you are running it against you do not need to supply a credential.

          Thanks!
          Zach

  6. 5:40 AM, 09/25/2013zubair  / Reply

    please let me know how to run the command and get the output.

    Im not getting the Output when i run the below
    PS E:\BMS\zubair\Powershell\New-AssetReport> .\New-AssetReport.ps1 -computername ahmedmr1

    PS E:\BMS\zubair\Powershell\New-AssetReport>

    • 11:22 PM, 09/25/2013Zachary Loeber  / Reply

      You should dot source the script first like so:
      . .\New-AssetReport.ps1

      Then call the function:
      New-AssetReport -ReportContainer $SystemReport -ComputerName -SaveReport -OutputMethod ‘IndividualReport’ -HTMLMode ‘DynamicGrid’ -Verbose

  7. 1:10 PM, 09/16/2013Ken Brown  / Reply

    Love the script – I will be using it extensively in our environment; however, The script starts then disappears without generating any information. I referred to the function call on the Microsoft site and modified the line referencing Server1 / Server 2 with my server names but it does not run properly. Do I need a computers.txt or servers.txt file for this to process?

    • 2:12 PM, 09/17/2013Zachary Loeber  / Reply

      Actually, I’ve not really setup any method for the script to accept input from a file (but you can easily do so yourself by piping in Get-content into the New-AssetReport Function. Otherwise something like the following should give you individual reports in the directory which you run the script (not the script location).

      $Servers = @(‘Server1′,’Server2’)
      New-AssetReport -ComputerName $Servers `
      -ReportContainer $SystemReport `
      -SaveReport `
      -OutputMethod ‘IndividualReport’ `
      -HTMLMode ‘DynamicGrid’ `
      -ReportName ‘report.html’ `

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pingbacks (0)

› No pingbacks yet.

Follow

Get every new post delivered to your Inbox

Join other followers