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 Adding an "Employee ID" column to an asset report
by  ABaker   Go to last post Go to first unread
Last post: Yesterday at 3:06:54 PM(UTC)
Lansweeper Firefox 102 & ESR 91.11
by  Esben.D  
Go to last post Go to first unread
Last post: Yesterday at 8:12:07 AM(UTC)
Lansweeper Performance report not shows result
by  NoraD   Go to last post Go to first unread
Last post: 6/28/2022 7:52:27 AM(UTC)
Lansweeper Duplicate AD Users
by  Randy Costa  
Go to last post Go to first unread
Last post: 6/27/2022 5:25:04 PM(UTC)
Lansweeper mail reports
by  swede   Go to last post Go to first unread
Last post: 6/27/2022 7:47:09 AM(UTC)
Lansweeper Multiple Devices Owned by Users (asset relations)
by  Adrian Scott  
Go to last post Go to first unread
Last post: 6/22/2022 5:34:51 PM(UTC)