Notification

Icon
Error

Powershell module for Lansweeper - Automation

Posted: Saturday, January 9, 2021 5:52:34 PM(UTC)
SubnetJO

SubnetJO

Member Original PosterPosts: 2
0
Like
Goodmorning
In my company we are using Lansweeper.
I need to to automate some tasks basing on the Lansweeper assets.
At its basics, I need to query and filter lansweeper assets and perform some tasks on each filtered asset.


Is there any supported way to integrate Lansweeeper into automation?

I use powershell.
I have found a module on the Powershell Gallery: https://www.powershellga...es/Lansweeper-PS/1.30.5

However, I cannot get it to work.

Could you please help me with this module?
How should be the get-LSasset command to get all the Assets object with all the properties

What I know is:
- Lansweeper server Ip address (and name)
- My username and password (I sucessfylly login and query assets on the web pages)

If you have different solution (python, .Net... whatever) please tell me.

Thank you for your kind help
ufficioced
#1ufficioced Member Posts: 50  
posted: 1/20/2021 12:34:06 PM(UTC)
Originally Posted by: SubnetJO Go to Quoted Post
Goodmorning
I need to to automate some tasks basing on the Lansweeper assets.
At its basics, I need to query and filter lansweeper assets and perform some tasks on each filtered asset.


I don't know if I understood your problem

You could use "deploy package" in Lansweeper web console: create a deploy package with the configuration you need and then a report filtering the right assets

in the report's asset list you can deploy the package to the assets

let me know, regards
SubnetJO
#2SubnetJO Member Original PosterPosts: 2  
posted: 1/24/2021 7:18:19 PM(UTC)
Originally Posted by: ufficioced Go to Quoted Post
Originally Posted by: SubnetJO Go to Quoted Post
Goodmorning
I need to to automate some tasks basing on the Lansweeper assets.
At its basics, I need to query and filter lansweeper assets and perform some tasks on each filtered asset.


I don't know if I understood your problem

You could use "deploy package" in Lansweeper web console: create a deploy package with the configuration you need and then a report filtering the right assets

in the report's asset list you can deploy the package to the assets

let me know, regards



Thank you for your kind answer
However, what I need is to query lansweeper programmatically, hopefully integrating with a powershell.

Let's say I want to know how many IP Locations with a name that starts with "XYZ" I have, and then doing something elsewhere basing on the result.

For example I have a list of licenses assigned to each IP Location.
I need to check if we have licenses still assigned to no longer existing sites.
So I need to compare the list of the licenses and the list of the alive sites.
Where I can get the list of the alive sites?
I'm told "look at the IP locations in lanswepeer".

So, since my scripts are powershell, my question is: how can I query Lansweeper by powershell?
I know of the "unofficial" module, I tried it, but I cannot get it to work.

Is there something Official?
Is there any programmatical way to query Lansweeper, without querying the undergoing database directly, of course

Thank you for your kind help
ufficioced
#3ufficioced Member Posts: 50  
posted: 1/26/2021 8:24:43 AM(UTC)
Originally Posted by: SubnetJO Go to Quoted Post

So, since my scripts are powershell, my question is: how can I query Lansweeper by powershell?
...
Is there any programmatical way to query Lansweeper, without querying the undergoing database directly, of course


You need an API but as far as I know is under deployment in Lansweeper.
I think you can use a different approach with reports (exporting for example in Excel) and deployments, but I don't really know your configuration so I can't assure you this is the right way.


Hendrik.VE
#4Hendrik.VE Member Posts: 74  
posted: 1/26/2021 1:48:59 PM(UTC)
We are using a similar approach in our environment to test the VNC connection to a dynamic list of Workstations using PowerShell.
How we do it is like this:
1. Daily export the list (based on a custom filter) of Workstations to a csv file
2. Scheduled Posh script imports the csv, executes a command to test the VNC port and sends the result to a mail recipient.


Importing the csv is done by this command:
import-csv -delimiter ';' -path "C:\Program Files (x86)\Lansweeper\Service\export\VNC-check.csv"

Testing the port is done by this command:
new-object System.Net.Sockets.TcpClient($rh, $p)

Active Discussions

Lansweeper Adding computer type to Windows 10 report
by  Brandon   Go to last post Go to first unread
Last post: Yesterday at 6:38:45 PM(UTC)
Report Center Hardware Inventory
by  Cori  
Go to last post Go to first unread
Last post: 4/16/2021 4:05:02 PM(UTC)
Lansweeper Windows Activation
by  Hendrik.VE   Go to last post Go to first unread
Last post: 4/16/2021 4:01:47 PM(UTC)
Lansweeper Microsoft True Up: Licenses combined with AD
by  swaelti   Go to last post Go to first unread
Last post: 4/15/2021 12:25:41 PM(UTC)
Lansweeper Cisco Duo and associated registry keys
by  dhoward  
Go to last post Go to first unread
Last post: 4/15/2021 12:30:14 AM(UTC)
Lansweeper Calls closed within SLA
by  TimHolmes1973  
Go to last post Go to first unread
Last post: 4/13/2021 5:25:38 PM(UTC)