Showing results for 
Show  only  | Search instead for 
Did you mean: 
Lansweeper Employee
Lansweeper Employee

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,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
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 =
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'


Lansweeper Employee
Lansweeper Employee

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.

Engaged Sweeper II

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?