Monitor Disk Space using a nice script

Hi everyone,

I was working to find a way to monitor disk space on servers. The solution is simple.
Go to one of your servers and open a PowerShell console as an administrator and type :
Set-ExecutionPolicy remotesigned

Now you can run the below attached scripts, but you need to customize some settings inside the script under the first section

Then you can run the script from a Power Shell window, or you can schedule it using Task Scheduler and it will send you couple of emails with nice reports.

Below is the script… I couldn’t upload the script in PS1 format, so i had to past it in a word document

Version 2 of the script is now available :

Script Features:

  • You can set different thresholds for C drives and data drives
  • You can set warning threshold and error thresholds
  • Email notification
  • You can customize the script to report certain logical drives

8 comments on “Monitor Disk Space using a nice script

  1. ammar the report is working great but i cant receive it by email, i filled the accounts needed at the bottom of the script

  2. yes dear its the same server that i have configured other scripts same as the exchange monitoring script i am receiving emails from that script 🙂

  3. on this line right ?

    #…………………….Send Email———————————————-

    If( ( ($ReportMode -eq 0) -and ( $Global:SomethingToReport -eq 1) ) -or ($ReportMode -eq 1) )
    SendEmail “” “” “DiskSpace_Alert_$(Get-Date -f ‘yyyy-MM-dd’)” “” $report

  4. Pingback: Version 2 of [ Monitor Disk Space using a nice script ] is now available | Ammar Hasayen - Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s