Solved

Need to modify vbs script which gets S.M.A.R.T. drive status

Posted on 2014-02-13
7
592 Views
Last Modified: 2014-02-20
I'm attaching a .vbs script I got from another site. I changed the extension to .txt. The script displays a dialog showing the local computer name but you can change that to the name of a computer on the LAN and it will return something like the following:

[computername] reports no S.M.A.R.T issues with the device"
'IDE\DisksST3160318AS______________________________CC45____________\4&167da70f&0&0.9.0
_0'.

I want to change the script so it does the following:
1. Pulls the names of computers from a file that contains a list of computer names, computers.txt.
2. Outputs the status to SMART Status.csv.
3. According to Wikipedia S.M.A.R.T. returns one of two responses,  "threshold not exceeded" and "threshold exceeded". If so then that is what I want in the .csv file. Regardless, I just want the basic info indicating if S.M.A.R.T. thinks the drive is failing.
4. If the drive or PC does not support S.M.A.R.T. data then the script should return. "not supported" for that particular machine.
5. The script should work with remote computers running Windows 7 and Windows XP.

Thanks,
Don
SmartStatus.txt
0
Comment
Question by:donander
  • 4
  • 2
7 Comments
 

Author Comment

by:donander
ID: 39859449
Cool. I looked for but could not find that zone.
Thanks!
Don
0
 

Author Comment

by:donander
ID: 39859459
I just realized there should also be an output if the machine is not reachable, so the four possible outputs would be:

1. Threshold not exceeded
2. Threshold exceeded
3. SMART not supported
4. Computer not found

Thanks,
Don
0
 
LVL 8

Expert Comment

by:TheNautican
ID: 39863387
Hey Don I worked this up and on my small network at home it works fine. Let me know how it works out for you and what tweaks you may want.

Regards,
-Naut
Q28364367.vbs
0
Swamped with email signature updates?

Have you been given a load of changes to make to your users’ email signatures? Having to manually implement multiple signatures for every department? Let Exclaimer save you from being swamped with email signature updates!

 

Author Comment

by:donander
ID: 39874478
Sorry for the delay in giving feedback. This script basically works. I'd like have the following changes made but if that is not possible then I can parse the output in its current format and will be happy to accept Naut's comment as the answer.

If the computer has no issues the script has this output. Note I have replaced the actual computer name with MYCOMPUTER.

MYCOMPUTER,Online,'MYCOMPUTER' reports no S.M.A.R.T. issues with device 'IDE\DiskST3250312AS_____________________________JC47____\4&3e91c9e&0&0.0.0_0'.

It would be nice to have instead just

MYCOMPUTER Passed

If S.M.A.R.T. is not supported you get

MYCOMUTER,Online,Drive(s) on MYCOMPUTER not currently enabled or drive configuration is incompatible for S.M.A.R.T. scanning.

it would be nice to have

MYCOMPUTER S.M.A.R.T. not supported.

I only did a test with about 50 computers and have not found any that did have issues so I can't say what the output is for that but I will try to do a test with several hundred computers today or tomorrow and maybe find some but I guess I hope there are none because I don't want any of them to be failing. Sort of a Catch-22 I guess :-)

Thanks,
Don
0
 
LVL 8

Accepted Solution

by:
TheNautican earned 500 total points
ID: 39874753
Don - Try this.

-Naut
Q28364367.vbs
0
 

Author Closing Comment

by:donander
ID: 39874851
The most recent script is excellent. This only leaves a small amount of post-scan parsing and I can easily do that. Naut is truly a VB Script Master!

Thanks very much!
Don
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hyper-V not working after Anniversary Update 7 51
Question to the line 4 40
Doubt. 2 57
"Black Box" Testing of Control System Software 2 25
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

910 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