Sunday, November 1, 2015

Poor man's inventory website using Powershell

I am always fascinated by HTML Inventory webpages scripts written by Don Jones's EnhancedHtml module and Alan Renouf's vCheck report. And always wanted to write same kind of my own script which will generate information data in the Web pages and they are linked to each other, Now I would like to proudly present my own version of script which creates complete website for given computer. 
It took me around 3-4 days to write this script, For all the Powershell writing it took me 1 hour, But combining and calibrating HTML and CSS coding with PowerShell took me all those 3-4 days, As this was my first time to write WebPage was great experience for me. (I don't have any knowledge on HTML, I written all these stuff by reading tutorial on, They have some great serious tutorials on HTML, JavaScript, CSS, Angular and so on... I went through almost all the tutorial on the site) You can download Web site creation script below. File name is All my testing done is on Windows 2012 R2, Windows 7, they are working fine, and collecting all required reports. This is just for demo purpose and I am still working on this script to make it compact and understandable.
Download Script
Download Script files

Here is this cool video how to run this script and how the collected and generated wesite looks like. Work is in still progress.

As of now this is just a demo script I have downloaded to get feedback from you which pulls some good information using WMI., Computer information pages are all I have designed and thinking what information I can put and thinking more on web pages designing, I tried to make Computer Information pages as fancy as possible and tried to add more data, now looking feedback from you.

This is a step by step demo how you can use the given script to build your own website hosted on either IIS or Apache.

Download the zip file, (I downloaded it on c:\scripts). and extracted it in same folder with same zip file name.
Once you extract zip file you will find there are 3 contents (1 folder and 2 files).
1) Images - Folder contains all the images required for your website
2) Get-ComputerInventory.ps1 - This script file will be executed to collect information from serverslist.txt. and create linked webpages for each server.
3) Serverlist.txt - You will have to put your server names in This text file.

Note: Do not to rename or change any file of folder names, and keep them in same folder.
Once you are all set with server list names. Open powershell (make sure you have script execution policy set to remotesigned at list. checkout my earlier blog to set-executepolicy), Next change (cd) the directory where my script and other supported files are located and execute that ps1 file.

make sure you are prefixing ./ the ps1 file.
and hit enter.

When the ps1 is executed completely, It will open inventory.html file, and also you can check the all the generated web pages under C:\Temp\WebSiteData. Here I am attaching those HTML files here to view how this website looks like. extract it anywhere you want and open InventoryList.html in browser. First page InventoryList.html is not well designed and I am still working on it.

Stay tune for more updates.
I have put this project on GitHub.
Post a Comment