Try the following script, it is self explanatory. This script will send an email to RECEIPIENT@DOMAIN.COM if the disk space is less than 1 GB. You need to modify the email account details and schedule it as a task.
Calculate free disk space on the server
Const HARD_DISK = 3
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK & "")
Set objComputer = CreateObject("Shell.LocalMachine")
i = 0
intCharacters = 5
flag = 0
For Each objDisk in colDisks
freespace = objDisk.FreeSpace
drive = objDisk.DeviceID
totalspace = objDisk.Size
totalspace = totalspace/1073741824
totalspace = Left(totalspace, intCharacters)
totalspace = totalspace & " GB"
freespace = freespace/1073741824
freespace = Left(freespace, intCharacters)
if freespace < 1 then
flag = 1
end if
freespace = freespace & " GB"
display = display + Cstr(objDisk.DeviceID) & " " + freespace + display1 &" "+ Cstr(objDisk.DeviceID) & " " + totalspace + vbNewLine + vbNewLine
computer = "Server: " & objComputer.MachineName + vbNewLine + vbNewLine + "Space Available on each drives: " + vbNewLine + vbNewLine
head = "Free Space Total Space" + vbNewLine + vbNewLine
Next
if flag = 1 then
Set objEmail = CreateObject("CDO.Message")
ObjEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="SMTP SERVER"
ObjEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
' ObjEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
' ObjEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="USER@DOMAIN.COM"
' ObjEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="EMAIL PASSWORD" ObjEmail.Configuration.Fields.Update
objEmail.From = "USER@DOMAIN.COM"
objEmail.To = "RECEIPIENT@DOMAIN.COM"
objEmail.Subject = "YOUR SUBJECT"
objEmail.Textbody = head + display
objEmail.Send
Set ObjEmail = Nothing
end if