
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2018 01:42 PM - last edited on ‎04-01-2024 04:45 PM by Mercedes_O
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.
Thanks!
Labels:
- Labels:
-
API & Integrations
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2018 11:39 AM
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
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
