Custom Alert in SCCM 2012 R2

sccm

Is it possible to create a custom alert in SCCM 2012 R2. I want SCCM to alert me when computers in a certain group have a less than a certain percentage of available hard drive space. I know there is a report for this by default, but I cannot figure out how to make SCCM alert me of the issue. Any help would be appreciated.

Best Answer

That kind of task would bedone more often with SCOM (versus SCCM). I don't think you can get an official SCCM alert in the monitorign console, but I can think of a 2 ways to do it with SCCM.

First would be to create a Query for devices that meet the criteria. No alert would be sent, you would have to review the query members every so often. If you have reports for free space, you've probably already done this, but for other readers, you also need to enable the Client Settings/Hardware Inventory collection of the Freespace property from Win32_LogicalDisk (see screen). Set the query to limited by the group/collection in question. The Query select would be as follows:

select SMS_R_System.Name, SMS_G_System_LOGICAL_DISK.DeviceID, SMS_G_System_LOGICAL_DISK.FreeSpace from  SMS_R_System inner join SMS_G_System_LOGICAL_DISK on SMS_G_System_LOGICAL_DISK.ResourceID = SMS_R_System.ResourceId where SMS_G_System_LOGICAL_DISK.DeviceID = "C:" and SMS_G_System_LOGICAL_DISK.FreeSpace < 1024 order by SMS_R_System.Name

client settings

The second menthod could be done via a Pacakge where you create a Program that is a Powershell sript, and schedule it to run once every 24 hours. This would send an actual email. Deploy the package to the group/collection in question.

$diskC = gwmi win32_logicaldisk | where {$_.deviceid -match 'C'} | select  systemname, @{n='gbFree'; e={[int]($_.freespace/1gb)}}, @{n='gbSize'; e={[int]($_.size/1gb)}}, @{n='percentFree'; e={"{0:N2}" -f ($_.freespace/$_.size)}}
if ($diskC.percentfree -lt .10) {
    send-mailmessage -subj "Low Disk" -to "who@where.com" -from "who@where.com" -smtpserver "mail.where.com" -body ($diskC | converto-html | out-string) -bodyashtml
}   

With such large disks, percentages are somtimes not always ideal triggers, you could also trigger with an absolulte size like this

if ($diskC.gbFree -lt 1) {