→ Celebrate SysAdmin Day 2024 with Lansweeper Enter our Giveaway here

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

Hi all,

I would like to be able to change a value of an asset based on a different value.

For example,

host1 - linux - VMware

I have a custom radio button on each asset that says if the host if "virtual" or "physical." Is there a way to have "IF host manuf desc = VMware, Then Custom Field = Virtual." I'd like to apply this "custom action" to all assets in the organization.

I couldn't easily find a way to do this.


Lansweeper Employee
Lansweeper Employee
There is a relatively easy way to do this. Basically you can create an Action which executes a DB script. When you run this action on the server running your database it should set everything as you want it to be.

For the action, you can use the following command: cmd.exe /K "sqlcmd -S myServer\instanceName -i C:\myScript.sql"

When you have your SQL script you can just replace the placeholders in the command to point to the correct database and script. You can also use {actionpath}VMscript.sql if you put the script in the Actions folder of your Lansweeper installation.

Quick last note, be sure to make a backup of your installation before performing custom database scripts, backup instructions can be found here: https://www.lansweeper.com/kb/94/backing-up-your-installation.html