→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !
‎11-18-2022 11:18 AM - last edited on ‎06-30-2023 03:04 PM by ErikT
As part of the Pro Tips #35 blog post I created a deployment package that deploys a PowerShell script that takes User Profile names and sizes and stores them into registry keys.
If you want to know more about it, you can visit the blog post. You can download the Powershell Script here. The script itself needs to be placed in the Lansweeper Scripts folder (C:\Program Files (x86)\Lansweeper\PackageShare\Scripts)
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:
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\UserProfiles' And tblRegistry.Valuename = '0') And tsysAssetTypes.AssetTypename = 'windows' And tblAssets.Lastseen IS NOT NULL And tblAssetCustom.State = 1 and tsysOS.OSname not like 'Win 7'
‎11-21-2022 08:31 PM
I got reports that Windows 7 is a problem. The registry key isn't populated successfully. I have updated the report to exclude windows 7. If you grab the lastest version, it should work.
‎11-21-2022 06:43 PM
I followed your instructions and started running the powershell script through deployment on a few PCs and things were woring fine. I was then able to run the report and get the profiles and sizes.
I then ran the powershell script on a wider group of PCs and about 80% deployed successfully while some didn't. Most of the failures were PCs that were not powered up.
Now when I try to run the report, I get an error message "Error: Invalid length parameter passed to the LEFT or SUBSTRING function."
Any thoughts on what's going on?
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now