I have script that does a query of the load of our terminal servers every hour during business hours for capacity planning.
At the moment the script emails out the details in the following format and we get an email every hour.
I would like to change this to a single HTML report, but have it so that the HTML report shows us the stats per server but shows us the number based on every hour, something similar to this:
****** TSFarm ********
Server 9am 10am 11am
HHG-TS518 36 36
HHG-TS519 36 36
HHG-TS520 37 37
HHG-TS521 36 36
HHG-TS522 36 36
HHG-TS523 36 36
HHG-TS524 36 36
HHG-TS525 35 35
HHG-TS526 35 35
HHG-TS529 23 23
Is there a way to achieve this without getting into piping the results to a SQL database? In my mind the problem is that once the script ends the data is lost unless I store it somewhere.
Any advice would be appreciated.
If I perform the query at 9am and it returns the following results
Then at 10am I perform the same query again
server 9am 10am
HHG-TS518 36 38
Would it be best to store these in an CSV file and then build the HTML report from the CSV file. Every time the script closes the data would be lost from powershell so need some way to get the previous data.