cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Graham_Ritchie
Engaged Sweeper II

Hi there,

We have Lansweeper up and running and have about 5000 assets. We need to import an asset tag to a custom field within the assets. I can get a list of Serial to asset tag and would like to know if there is a way to mass import this?

I can see topics asking similar questions from years ago stating there is no way to do this, but it might be implemented  in the future.

Is there now a way to do this? If not, how are others getting asset tag information into Lansweeper? Is there a way to do it via SQL?

Thanks

Graham

1 ACCEPTED SOLUTION
Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

Unfortunately, our asset import functionality can indeed only be used to import new assets into the Lansweeper database, it can't be used to update assets that are already in the Lansweeper database. This feature was added to our customer wish list.  We aren't able to guarantee that this feature will be implemented or provide you with an estimated release date at this time.

Manually adding the asset tags to the assets would indeed be the preferred option, although this task can be cumbersome if the change affects many assets.

Theoretically, you could also accomplish this with a custom database script, but we don't provide support for this. If your Lansweeper installation is broken due to a custom database script, you would need to perform a restore of your Lansweeper installation.

Below is a high-level example of how you might go about this with a custom database script. Lansweeper has a built-in asset property called Barcode. If you didn't enter other information into it for any asset, you could use this field to store your asset tags. Then your database script could look something like this:

 

UPDATE tblAssetCustom Set BarCode='12345678' WHERE tblAssetCustom.Serialnumber = 'ABCDEFG'
GO
UPDATE tblAssetCustom Set BarCode='12345679' WHERE tblAssetCustom.Serialnumber = 'ABCDEFH'
GO


The above script would set the Barcode property based on the serial number of the asset. You can use other properties of course in your where clause. The above script updates two assets, but you can expand the query as much as you like. If you are already using the Barcode property for something else, you could also use one of the custom fields as described here: https://www.lansweeper.com/knowledgebase/configuring-and-adding-data-to-asset-custom-fields/

  • Just to be safe, we do recommend performing a database backup prior to running any scripts. Do not skip this step. Backup instructions can be found here: https://www.lansweeper.com/knowledgebase/backing-up-your-installation/
  • Stop the following services:
    • The Lansweeper server service (on all your scanning servers).
    • The web server service on your Lansweeper web server. Your web server service is either World Wide Web Publishing Service (IIS) or IIS Express.
  • Afterward, open the DatabaseMaintenance.exe tool which can be found under Program Files (x86)\Lansweeper\Tools on your Lansweeper server or, alternatively, use SQL Server Management Studio if your Lansweeper database is hosted on SQL Server.
  • Copy/paste your script in the second tab labeled Script Execution, and click Execute.
  • Restart your services.

View solution in original post

2 REPLIES 2
LSEngineer2007
Engaged Sweeper II

We also have a lot of assets, (around 250,000), we created a custom powershell script that allows me to update every field on every asset except for Asset Name.  If you don't have someone at your organization that knows how to write scripts like this, here are 2 other options.  Not ideal but options nonetheless...

  1. Update all of the assets manually using Mass Edit Assets menu.  Change your view to 1,000 and you will need to bring the desired assets up by filtering by certain fields (maybe by Location or Model).  If you can get them all up, sort by serial # and sort your spreadsheet the same way that has the asset tags.  While in the Mass Edit Assets menu, you can copy and paste the asset tag just like you would be able to if you are working in Excel.  5,000 is still a lot to do manually but even if you are able to do it in chunks you can update them fairly quickly.
  2. If you don't care about any historical information on the assets, you can delete the assets and reimport them with the all of the populated fields that you had before and also include the asset tag.  Create a report that includes every desired field then you can transfer that data to the Asset Import template and reimport them into LS.  You can also delete 999 at time using Mass Edit Assets.  I literally just did this for a few thousand monitors, they were missing asset tag, PO Number (custom field), and purchase/warranty dates.   I deleted and reimported with the missing data and it took less than 5 minutes. 
Keith
Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

Unfortunately, our asset import functionality can indeed only be used to import new assets into the Lansweeper database, it can't be used to update assets that are already in the Lansweeper database. This feature was added to our customer wish list.  We aren't able to guarantee that this feature will be implemented or provide you with an estimated release date at this time.

Manually adding the asset tags to the assets would indeed be the preferred option, although this task can be cumbersome if the change affects many assets.

Theoretically, you could also accomplish this with a custom database script, but we don't provide support for this. If your Lansweeper installation is broken due to a custom database script, you would need to perform a restore of your Lansweeper installation.

Below is a high-level example of how you might go about this with a custom database script. Lansweeper has a built-in asset property called Barcode. If you didn't enter other information into it for any asset, you could use this field to store your asset tags. Then your database script could look something like this:

 

UPDATE tblAssetCustom Set BarCode='12345678' WHERE tblAssetCustom.Serialnumber = 'ABCDEFG'
GO
UPDATE tblAssetCustom Set BarCode='12345679' WHERE tblAssetCustom.Serialnumber = 'ABCDEFH'
GO


The above script would set the Barcode property based on the serial number of the asset. You can use other properties of course in your where clause. The above script updates two assets, but you can expand the query as much as you like. If you are already using the Barcode property for something else, you could also use one of the custom fields as described here: https://www.lansweeper.com/knowledgebase/configuring-and-adding-data-to-asset-custom-fields/

  • Just to be safe, we do recommend performing a database backup prior to running any scripts. Do not skip this step. Backup instructions can be found here: https://www.lansweeper.com/knowledgebase/backing-up-your-installation/
  • Stop the following services:
    • The Lansweeper server service (on all your scanning servers).
    • The web server service on your Lansweeper web server. Your web server service is either World Wide Web Publishing Service (IIS) or IIS Express.
  • Afterward, open the DatabaseMaintenance.exe tool which can be found under Program Files (x86)\Lansweeper\Tools on your Lansweeper server or, alternatively, use SQL Server Management Studio if your Lansweeper database is hosted on SQL Server.
  • Copy/paste your script in the second tab labeled Script Execution, and click Execute.
  • Restart your services.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now