Notification

Icon
Error

HDD vs SSD PowerShell Script Deployment

Posted: Friday, February 25, 2022 3:45:40 PM(UTC)
Esben.D

Esben.D

Member Administration Original PosterPosts: 2,186
0
Like
As part of the Pro Tips #16 blog post I created a deployment package that deploys a PowerShell script that takes storage type data and stores it into registry keys.

If you want to know more about it, you can visit the blog post. You can download the Powershell Script here (right click, save link as...).

Below you can also find a report that you can use to deploy the script to all devices that do not have the registry keys scanned yet:
Code:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where tblAssets.AssetID Not In (Select tblAssets.AssetID
From tblAssets Inner Join tblRegistry On tblAssets.AssetID =
tblRegistry.AssetID
Where tblRegistry.Regkey Like '%System\HDD' And
tblRegistry.Valuename = '0') And tsysAssetTypes.AssetTypename =
'windows' And tblAssets.Lastseen IS NOT NULL And tblAssetCustom.State = 1
Script - Storage TypeDownload Package
DescriptionDiscover the type of storage drives on your Windows assets by storing the data in a regsitry key. Assets are rescanned after deployment. Visit the blog post to learn more about this use case: https://www.lansweeper.com/pro-tips/hdd-or-ssd/
Final ActionNothing
Max. Duration15 min(s), 0 hour(s)
RescanYes
Steps
1. Run Powershell Script
TypeCommand
Return Codes 0,1641,3010
SuccessStop (Success)
FailureStop (Failure)
Command powershell.exe -executionpolicy bypass -file "{PackageShare}\Scripts\disktype.ps1"

Active Discussions

Lansweeper Lansweeper Dark Theme
by  mrobbins   Go to last post Go to first unread
Last post: Yesterday at 5:38:01 PM(UTC)
Lansweeper Detect Docking Stations
by  GlenH  
Go to last post Go to first unread
Last post: Yesterday at 3:52:13 PM(UTC)
Lansweeper Exclude non-windows assets from scanning by assetname
by  rapheren   Go to last post Go to first unread
Last post: Yesterday at 1:18:12 PM(UTC)
Lansweeper HTTPS Certifikate untrusted
by  pskup  
Go to last post Go to first unread
Last post: Yesterday at 9:20:07 AM(UTC)
Lansweeper Migrate to new host but without SQL
by  pskup   Go to last post Go to first unread
Last post: Yesterday at 9:03:14 AM(UTC)
Lansweeper Object reference error after updating to 10.2.0.0
by  Erik.T  
Go to last post Go to first unread
Last post: Yesterday at 8:10:25 AM(UTC)
Lansweeper Custom reporting - Asset Groups and AD Description
by  rbshawn   Go to last post Go to first unread
Last post: 6/29/2022 10:54:10 PM(UTC)
Lansweeper A FIX for an odd Scan Error WMI/DCOM from scanning server
by  danielm  
Go to last post Go to first unread
Last post: 6/29/2022 10:14:44 PM(UTC)