Improved SSD Detection During Task Sequences
Lots of you will be familiar with my script I posted last year to enable the detection of solid state disks during a task sequence. I have had much success by tweaking the script in different environments depending on the drive. In this post I will walk through a more reliable way to detect the presence of SSD drives in your task sequences.
Within Windows 7 and Windows 8 we can use the Windows Performance Index rating or WinSAT to determine the performance factor of the machine.
We can use WinSAT in a couple of ways to detect your SSD drives and using the built-in capabilities of WinSAT to reliably detect your SSD drives. These methods both use WinSAT, one uses a script in MDT (doesn’t have to be in MDT) and another uses WMI.
Detection via WMI
The first method uses WMI and a full WinSAT test to determine the score of the disk. It is safe to assume from tests that a standard disk will never be higher than 6.9 and SSD disks exceed 7.0 (usually around 8.0 or higher).
To begin we need to run WinSAT in our task sequence. We can do this running a normal run command line task sequence step. The configuration of this step would look like as follows.
Depending on system performance this will take around 3 or 4 minutes to run. When WinSAT has finished you will find the results in WMI which you can find in the Win32_WinSAT class. For our purposes we will need the DiskScore property. You have two options here, you can either specify a condition on the task sequence step which queries WMI for a disk score above 6.9. This would look something like the following.
You can also set a task sequence variable after WinSAT has finished which will determine the state of your disk again using the above condition to set the variable and then base your task sequence steps based on the value of the variable. It’s an extra step but will clearly work as well as just running the condition shown above. For the purpose of copy and paste, here is the WMI query.
SELECT * FROM Win32_WinSAT WHERE DiskScore > "6.9"
The second method uses a script. As well instead of using the formal method of detection, this still performs a random read write test just like the method above however this method only performs this one test thus making it quicker to execute. If time is important then you can use this method.
You can download the script from my SkyDrive: http://sdrv.ms/133Q8Hl
Safe the file as a .wsf and add it to your MDT toolkit package.
This will set a variable called DiskPerf to be the value of the WinSAT results. The difference here is that the following command is ran:
winsat.exe disk -seq -read
The other difference is that running this command does not populate WMI with the value of the test, this only happens when the formal command is executed.
So here you have it, two improved and more accurate ways to detect your SSD drives. Depending on your requirements and time constraints you can use either method of detection.