Basically I wrote this project as an fun/poc, but it went very well. I wanted to show the HTML + PowerShell capabilities to my (Asset collection team) colleagues as there are endless possibilities what you can build using HTML + Powershell. After launching the html file in the chromium browser the webpage looks like below. Records are pulled from JSON file format. The information is all shown about server hardware information, when you hover over information it shows additional detailed information. In the additional details, it shows the low level hardware information like Model and Part numbers, speed it is useful when replacing hardware parts, you dont need to open system and check the information.
The purpose of this script is, we had few Microsoft Windows Hyper-V host where we wanted to show complete hardware information on the web page (Asset Collection Team was doing this task manually) with server name search.
If you see inside the folder there are 3 main files and these 3 files need to be in the same directory.
- PowerShell ServerAssetInventory.ps1, which pulls the Computer names from Active Directory, connect to the servers over winrm protocol to CIM (The “Common Information Model” (CIM) is an open-source standard for accessing and displaying information about a computer.). And starts Collecting the hardware information, You can run the script using Task Scheduler to daily update the data.
- Once information is collected by PowerShell script, it is stored in JSON format under data.js file.
- Once database is generated, Open the Index.html file in the browser, and your inventory website is working, it doesn't require web server.
I have already put some demo data inside the data.js file for your testing purpose.
This is the work flow how to setup the script and inventory website in the scheduler and access the index.html file from either web server or file server.
Related Articles:
Install and Configure IIS Web Server on Windows Server
Install an SSL-TLS Certificate In Microsoft IIS web server
This is the small video in the action of web page.
Download this complete HTML reporting script here or it is also available on github.com.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 100 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
#Created By: http://vcloud-lab.com #Date of creation: 27/08/2021 #Tested Environment: # PowerShell 5.1 # Browser: Microsoft Edge, Google Chrome
|
Useful Articles
CREATE AND CONFIGURE SYMBOLIC LINK (MKLINK) ON WINDOWS SERVER
Part 1: Powershell: Get registry value data from remote computer
Part 1.1: Microsoft Powershell: Export remote registry information to excel
Part 2: Microsoft Powershell: remotely write, edit, modify new registry key and data value
Part 3: Microsoft Powershell: Delete registry key or values on remote computer
Get the List of installed softwares on remote computers with PowerShell