Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Code Snippet from aperturescience.su
- #
- # SMART Status for physical disks
- #
- Write-Verbose "Starting physical drive checks..."
- $drives = Get-WmiObject win32_diskdrive
- foreach ($drive in $drives)
- {
- $deviceid = $drive.deviceid
- Write-Verbose "checking $deviceid"
- $model = $drive.model
- $status = $drive.status
- $serial = $drive.serial
- Write-Verbose "$deviceid $status"
- if ($status -ne "OK")
- {
- #drive has some sort of not-ok predictivie failure
- send-email "WARNING: Physical drive $deviceid has a predictive failure status of $status. `n Information for troubleshooting: Drive model: $model, Drive Serial: $serial" $false
- }
- else
- {
- send-email "Physical drive $deviceid is not in a predictive failure state" $true
- }
- }
- # Code Snippet from aperturescience.su
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement