looking for a powershell script that will check for low disk space on approx. 10 win2k8 servers and send an email alert if the space drops below 15%

Posted on 2011-05-10
Last Modified: 2012-05-11
can someone provide a script that will check for low disk space on a set of servers [reference a .txt file for the server list] and send out an email alert if the space drops below 15% on any of them in the list?

I also have the quest AD commandlets installed if you have a version of the quest posh script that can accomplish this.

many thanks,


Question by:siber1
    LVL 13

    Accepted Solution

    This is a prototype for this:
    Get-Content c:\serverlist.txt | ForEach-Object {Get-WmiObject -Class Win32_LogicalDisk -ComputerName $_ -Filter "drivetype=3"} | %{
        Add-Member -InputObject $_ -MemberType noteproperty -Name freepercent -Value ($_.freespace/$_.size*100) -PassThru
    } | ?{$_.freepercent -lt 15} | ForEach-Object {
        $message = "Low disk space on server $($_.__server) on disk $($, actual free size $([int] $_.freepercent)%"
        Send-MailMessage -Body $message -From -To -SmtpServer -Subject "Low disk space notification"

    Open in new window


    Author Closing Comment

    excellent! just what i was looking for.
    thx much!

    Featured Post

    Are your corporate email signatures appalling?

    Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

    Join & Write a Comment

    "Migrate" an SMTP relay receive connector to a new server using info from an old server.
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
    In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now