Skip to content

Using PSHTML module, create a dashboard which shows Disk usage of servers in your network.

Notifications You must be signed in to change notification settings

MessagingAdmin/DiskSpaceReport

Repository files navigation

DiskSpaceReport

Using PSHTML module, create a dashboard which shows Disk usage of servers in your network.

• Get-DiskSpaceData This function uses cmdlet “get-wmiobject” to fetch data from servers. The data returned by this function should be exported to a csv file. This csv file is then passed on to remaining functions for data manipulation Syntax: Get-DiskSpaceData -ComputerName

Example 1: Get-DiskSpaceData -ComputerName Server1, Server2, Server3, Server4 | Export-Csv DiskData.csv -notypeinformation

Example 2: Get-DiskSpaceData -ComputerName (Get-content Serverlist.txt) | Export-Csv DiskData.csv -notypeinformation

• Convert-DiskSpaceData This function accepts csv file generated by Get-DiskSpaceData cmdlet. Function adds additional columns in csv file. Two columns are added to the file are for displaying friendly value of the disk size (in MB, GB, TB) instead of size in bytes returned by get-wmiobject. Another column is added to calculate % of disk space utilized. Last column is for showing the alert level, if the utilization % is more than 80%, the column will have value red else, it will show green. This column is need for our html code.

• New-DataReport This is where all the html code is written using PSHTML module cmdlets. The function parses the csv file and prepare a nice looking dashboard.

Finally, you can write up a central script (sample below) which uses above functions and generates a report.

About

Using PSHTML module, create a dashboard which shows Disk usage of servers in your network.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages