Jetzt Ausprobieren
Pro Tips

HDD or SSD?

4 min. read
25/02/2022
By Esben Dochy
Pro-Tips-with-Esben-16-HDD-or-SSD

Pro Tips with Esben #16

Arguably one of the most impactful changes when it comes to the user experience of modern IT devices is the widespread usage of Solid State Drives. Today we’ll take a look at how you can detect how widespread SSD usage is in your IT environment.

Far gone are the days you turned on the power of your computer before making a cup of coffee and reading the newspaper while your computer serenades you with a compilation of mechanical noises. Most devices, even when fully turned off, boot up in seconds rather than minutes. Aside from the user experience of devices, SSDs have greatly benefited servers, network storage, virtual machines and more. As a result, knowing which types of storage devices are installed in a server or workstation is a must-have.

While Lansweeper can easily pick up details of your storage devices like the size, type, model, partitions and more, the distinction between HDD or SSD isn’t data that is stored in the WMI classes we scan.

Powershell Time!

As is often the case, PowerShell can help us. To get the data we want, and get it in Lansweeper, we’ll use a combination of PowerShell, deployment and registry scanning. To start we’ll need to grab the data using PowerShell and store it in a registry key.

You can download the PowerShell script here (right click, save link as…).

The script checks and creates the registry key HKEY_LOCAL_MACHINESYSTEMHDD, after creating it, it will query the PowerShell function Get-PhysicalDisk | Select FriendlyName, MediaType. For each row that is retrieved, a new registry value is created, starting with the name 0 and counting upwards.

Storage drives regsitry keys

Obviously, you’re free to adjust the script to your needs if you’d like to change the registry key and values created.

Deploying the Script

Now that we have a script, it’s time to push this out to all Windows devices. I’ll cover how you can do this with Lansweeper, but obviously, you can use your own preferred solution that lets you deploy PowerShell scripts to devices (GPO, Intune, etc.).

To deploy it with Lansweeper, I’ve created a deployment package that you can use in combination with a report. You can find both of these resources in the deployment forum post.

You can import the deployment package into your Lansweeper installation and use the attached report as a target list. The report will contain all assets that do not have the registry keys scanned. Once the deployment is complete, Lansweeper will automatically rescan the asset and it will automatically be removed from the target list report.

Storage drive deployment

Scanning the Data

Now that all the data is in registry keys, the last step is simple. Add the registry keys to your registry scanning configuration. Depending on how many drives you have in a single device, you’ll have to adjust how many registry values you scan. Remember, each drive gets its own registry value!

storage drive key scanning

Reporting

Finally, we get to viewing the data in Lansweeper. I’ve made two reports, the first provides an overview per asset of the data scanned from the registry keys. However, it is limited to 10 separate drives, which should be enough in most scenarios.

The second report is a new version of the old HDD vs SSD report, which relied on matching user input with the model name of drives detected by Lansweeper. In this new version, the report looks for a match between the Powershell drive name and the Lansweeper drive model name. If an exact match is found (let’s hope this is the case in most scenarios), the drive type is listed.

HDD vs SSD PS report