This page explains the built-in asset and user actions in Lansweeper, and how to create your own actions.
Actions in the Lansweeper platform are administrative or other tasks you can perform on the asset or user page you're viewing. They allow you to do things like open the webpage of an asset that has HTTP or HTTPS enabled, open the administrative shares on a Windows computer, set up a remote desktop session, reboot a Windows computer, reset the password of an Active Directory user and more.
To accomplish these tasks, actions use underlying CMD commands, scripts and executables, which are stored in a folder on the Lansweeper server. There are built-in actions, but you can create your own as well.
Actions are listed in the left pane of asset and user pages in Lansweeper Classic.
Create actions
- First locate the command or tool you can use to perform the specific task related to an asset or a user. You can use a built-in Windows tool or command or integrate a third-party tool with Lansweeper.
The tool or command must run successfully from a Windows computer. The underlying command of a Lansweeper action is run on the machine you're accessing the web console from.
An action is different from a deployment package in that sense. When you run a deployment on a Windows computer, the underlying command of the deployment is run locally on the client machine you're targeting with the deployment. However, when you run an action, the underlying command is not run locally on the targeted client machine. Instead, it is run on the machine you're accessing the web console from. The underlying command or tool of the action must support performing a task related to the targeted client machine.
- Add the tool or any files required by it to the
Program Files (x86)\Lansweeper\Actions
folder on your Lansweeper server. By default, this folder is shared as lansweeper$.
- If your action is a CMD command that doesn't call any scripts or executables, you don't need to add anything to the lansweeper$ folder.
- If your action references a built-in Windows tool that can be found under
C:\Windows\System32
on Windows computers, you don't need to add anything to the lansweeper$ folder. When you add the action to the Lansweeper Classic web console, you can just start the action with the name of the tool. Lansweeper will automatically try to locate the tool under C:\Windows\System32
when the action is run.
- If your action references a third-party executable, tool or script, add it to the lansweeper$ folder on your Lansweeper server.
- Add your action to the Lansweeper Classic web console.
Asset actions can be added in the Configuration > Asset Pages section of the web console.
User actions can be added in the Configuration > User Pages section of the web console. Keep in mind that user actions can only be run on domain users, not local users.
Available settings
When submitting an action in the web console, the following settings are available:
- Description: The name of the action as you want it to appear on asset or user pages.
- Action: The underlying command of the action. If your action references a third-party executable, tool or script, make sure to start the action command in Lansweeper with the {actionpath} parameter.
- Icon: The icon that accompanies the action on asset or user pages. There are built-in icons but you can also add your own to the
Program Files (x86)\Lansweeper\Actions
folder on your Lansweeper server.
- Sort order: The order in which the action is displayed among other actions on asset or user pages. A lower number means the action is listed more towards the top of the list.
- Enabled: If checked, the action is listed and available for use on asset or user pages. If unchecked, the action is not listed on asset or user pages.
- Ask for confirmation: If checked and a user runs the specified action, a confirmation pop-up is presented. Only when the user confirms in the pop-up is the action executed.
- Advanced action: If checked, the action is listed in the Advanced Actions section on asset or user pages. If unchecked, the action is listed in the Basic Actions section.
- Render as Hyperlink: If checked, the action is treated as a hyperlink. Only check this option if your asset or user action is in fact a URL.
Available parameters
Parameters available for use in asset action commands:
- {actionpath}: This is the Action Path folder specified under Configuration > Asset Pages in the web console. By default, this parameter refers to the lansweeper$ shared folder on your Lansweeper server, which is automatically generated by the Lansweeper installer. If you want to use your own shared folder to store actions, you can submit it as your Action Path.
- {smartname}: This is replaced with the asset's NetBIOS name, FQDN or IP address, depending on the asset type.
- {assetname}: The (NetBIOS) name of the asset. This parameter can be used for any asset type.
- {dnsname}: The DNS name of the asset.
- {computer}: The NetBIOS name of the asset. This parameter only works for Windows computers.
- {domain}: The NetBIOS domain name of the asset.
- {tag}: The serial number of the asset.
- {username}: The name of the last logged on user of a Windows computer.
- {userdomain}: The NetBIOS domain name of the last logged on user of a Windows computer.
- {ipaddress}: The IPv4 address of the asset.
- {fqdn}: The FQDN (Fully Qualified Domain Name) of the asset.
- {scanserver}: The name of the last scanning server to scan the asset.
- {assetid}: The database ID of the asset. Every asset gets a sequential, numeric ID when it's added to the Lansweeper database.
- {mac}: The MAC address of the asset. For devices with multiple MAC addresses, this is the MAC address listed at the top of the asset page.
The following parameters are available for use in user action commands:
- {actionpath}: This is the Action Path folder specified under Configuration > Asset Pages in the web console. By default, this parameter refers to the lansweeper$ shared folder on your Lansweeper server, which is automatically generated by the Lansweeper installer. If you want to use your own shared folder to store actions, you can submit it as your Action Path.
- {username}: The name of the Active Directory user.
- {userdomain}: The NetBIOS domain name of the Active Directory user.
- {displayname}: The display name of the user as specified in Active Directory.
- {telephone}: The telephone number of the user as specified in Active Directory.
- {fax}: The fax number of the user as specified in Active Directory.
- {mobile}: The mobile phone number of the user as specified in Active Directory.
- {email}: The email address of the user as specified in Active Directory.
- {ou}: The OU (Organizational Unit) the user resides in in Active Directory.
- {cn}: The path of the user in Active Directory, e.g. cn=John Doe, cn=users, dc=mydomain, dc=local.
Run actions
- Grant the appropriate users the right to run asset and user actions.
There are two permissions for running actions, one for running basic actions and one for running advanced actions. You can configure which actions are basic and which are advanced. Info on setting up permissions in the web console can be found in this knowledge base article.
- Configure your web browser to run actions. Officially supported web browsers are Google Chrome, Mozilla Firefox, Opera and Microsoft Edge.
- Configuration instructions for Google Chrome can be found in this article.
- Configuration instructions for Mozilla Firefox can be found in this article.
- Configuration instructions for Opera can be found in this article.
- Configuration instructions for Microsoft Edge can be found in this article.
- Browse to the Lansweeper webpage of the asset or user you want to run the action on. You can then select the action on the left side of the page.
Was this post helpful? Select Yes or No below!
Did you have a similar issue and a different solution? Or did you not find the information you needed? Create a post in our Community Forum for your fellow IT Heroes!
More questions? Browse our Quick Tech Solutions.