Forum Discussion
captaindanger27
Sep 01, 2021Copper Contributor
Send email if iSCSI disk is not ONLINE
I would like to check if an iSCSI disk is online and if not then send an email. The command we use to check the status is Get-Disk | Where-Object -FilterScript {$_.BusType -Eq "iSCSI"} The output ...
farismalaeb
Sep 03, 2021Steel Contributor
$X=$X=(Get-Disk | Where-Object -FilterScript {$_.BusType -Eq "iSCSI"} ).OperationalStatus
IF ($X -NOTLIKE "Online"){
Send-MailMessage -From Alert@domain.com -To Admin@domain.com -Subject "HolyMoly The Disk is offline" -SmtpServer mysmtpserver.domain.com -Body "Here is the Message Body"
}
Please Click on Best Response if this answer helped.